Skip to main content

Hi there, I am trying to use FME to automate some user management for FME Server. Specifically I would like to schedule a workspace to remove any Azure users that are not members of a role. I have worked out how to list the users and get their roles, but I can't work out how to go from this json array: ["user:admin","fmeadmin","fmesuperuser"] to the integer value 2.

 

Can anyone please help me drop the "user:..." part from the array and count the number of items that are left over?

 

Thanks!

Marc

Nevermind, I adapted the answer from here: https://community.safe.com/s/question/0D54Q000080hL8CSAU/count-elements-in-json-array

 

changing it to: jn:size(fme:get-json-attribute("user_roles_json"))

 

Then I can just subtract 1 from the value to remove the "user:..." part which is always present.

 

Easy. Thanks @Takashi Iijima​ 


Reply