0

I have created a workflow that calls https://site.sharepoint.com/sites/site/_api/Web/CurrentUser and stores the user ID in a variable called userId.

I am then passing that userId into another call /_api/Web/getUserbyId([%Variable: userId%])/Groups. Now I am storing the results of the second call in a variable called JSONResultsGroup

Next I want to get the Title of the groups from the dictionary. I am using Get d/Title from Variable: JSONResultsGroup (Output to Variable: dataset )

Then counting the items in the dataset and storing the count in resultsCount variable.

For troubleshooting I am logging the count of the variable, but I never seem to get any results. I have tried many different variations in the Get d/Title call but cant seem to get the path of the json correct.

enter image description here

Actual workflow:

Call ://site.sharepoint.com/sites/ksec... HTTP web service with request (ResponseContent to Variable: JSONResults |ResponseHeaders to Variable: responseHeaders |ResponseStatusCode to Variable: responseCode )

Get Id from Variable: JSONResults (Output to Variable: userId )

Log User ID Is [%Variable: userId%] to the workflow history list

Call ://site.sharepoint.com/sites/ksec... HTTP web service with request (ResponseContent to Variable: JSONResultsGroup |ResponseHeaders to Variable: responseHeadersGroup |ResponseStatusCode to Variable: responseCode1 )

Log 2nd call is [%Variable: responseCode1%]  to the workflow history list

Get d/Title from Variable: JSONResultsGroup (Output to Variable: dataset )

Count Items in Variable: dataset (Output to Variable: resultsCount )

Log resultscount [%Variable: resultsCount%] to the workflow history list
3
  • My biggest breakthroughs on this came when I modeled my queries in an outside tool like SmartBear's SoapUI, or chrome apps like postman or boomerang. You likely are getting back a dictionary with a different architecture than you expect.
    – ghangas
    Commented Oct 14, 2016 at 20:56
  • I do have Postman installed, i will run the query through there and look at results. thanks for the suggestion! Commented Oct 14, 2016 at 21:13
  • You are on the right track. d/Title is actually "". You are accurately pulling that. The next step might be to track down something like d/entry('1')/content/properties/Title/__text. There are some other things you may need to do like getting d/entry into another dictionary so you can loop through it. you can loop and pull i/content/properties/Title/__text
    – ghangas
    Commented Oct 15, 2016 at 4:45

1 Answer 1

0

I think it should be something like this:

Get d/results([%numIndex%])/Title from Variable: JSONResultsGroup (Output to Variable: dataset )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.