Convert JSON output of List Users command
AnsweredHi All,
I am trying to export the list of Workiva users in a chain and then upload to a Workiva table. I am able to get the list of users using the "List Users" command in the chain. But then I'm not able to convert the JSON output using any of the JSON commands or the Handlebars tool. All of the tools I use say they're successful, but there's no actual output of data. The first thing I tried was just getting the emails out of the array with even that isn't working. Can anyone advise? Here are some pictures of the chain and the commands that I've tried.



-
Your Array to CSV command is very close. The user information is nested in an object "attributes" so your JSON path would be ".attributes.email"

Regards, Wade
--
Wade Hays - Tower Turn0Thank you Wade! That worked.
0Hi Wade,
I am also trying the same thing but i also want to extract list of all the workspace and workspace roles associated to that user, how can i do that?
Ragards,
Anurag
0Hi Anurag Shukla,
You can get workspace and workspace roles in attributes.workspaceMemberships. For more information and to see an example response of all information available, please reference https://developers.workiva.com/admin-v1/admin-getorgreportusers/#example-responses.
0Hi Jeff Hickey, I am attempting to do the same as above - retrieve workspace and role information using the List Users command. Would 'attributes.workspaceMemberships' be used in an Array to CSV command? I am attempting to add it here and I get an error upon running the chain using the first method and blank column outputs using the second method.

0I had the same issue when trying to troubleshoot it. In the end the nested Arrays were the problem and we needed to add the [ ] to get it to work. IF we put a [*], it brings back all the detail for the nested array. if you are going after Workspace roles, you end up in an Array, of Arrays, of Arrays, so you need to leverage it twice. This screenshot shows how we got it working.
0Wow, thanks! That did the trick.
0Stephenie Kern Just getting off the ground with this - how'd you get the content of the List Users output? Feeling like a newb here.
0Hi Nick,
After you "Array to CSV" command, you can access the output in your next command. It will be in your list of outputs on the left hand side. It should be called "converted file".
0Hi Nick Ryberg, I reccomend reviewing the resources available in Getting Started with Data Management. This post compiles links to many resources to help you begin to learn the Data Management Suite and Chain building!
0Thank you! That left bar wasn't visible for me (at first) and now it makes sense.
0Please sign in to leave a comment.
Comments
11 comments