1

I am getting list items using Web Service action in SPD 2013 workflow. Then looping through these items I am setting workflow variables like Title, State.

For example: value in Title variable are "123", "456","789" and State are "Done","Pending", "Done".

Now I need to construct a Json using these variables in below format:

{
"Title":"123",
"State":"Done"
},
{
"Title":"456",
"State":"Pending"
},
{
"Title":"789",
"State":"Pending"
}

If anyone has done this or can point me in right direction, as when I try to build it as string it throws error and then I tried to add these as a dictionary containing a dictionary but not able to add items in dictionary in loop dynamically. Below is screenshot of Web Call and loop.

enter image description here

  • Are you not able to create string variable in loop? Also can you please tell us the exact requirement why are you building json string?maybe there will be another work around we can suggest. – Ganesh Sanap Jan 17 at 10:26
  • I am able to create string variable but I cannot use { this special character. I am trying to save some data in one of the fields in the list, that I want to show elsewhere on a dashboard – zainul Jan 17 at 10:57
  • So you can directly stored the string values in other fields in list? is there any specific reason to build the data in json format? as it is bit tedious to build and there are many limitations in dsigner workflow too. – Ganesh Sanap Jan 17 at 10:59
  • Because what I am trying to save is like 100 items with 3 fields so 300 values I need to track and I am trying to save this in a multiple line text of a field. Based on this I need to construct in UI. – zainul Jan 17 at 11:26
0

If you want to set multiple line of text field with JSON results from REST API in designer workflow, we can get the JSON results from response content and output to a dictionary, then set the field with this dictionary.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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