Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
  • 1.  Complicate JSON

    Posted Apr 08, 2021 03:38 AM
      |   view attached
    Looking for some help guys, first post here :)

    I have an api connection to formsite to collect the form responses however, the json output is extremely complex with a nested object for each question.  I am tryng to ascertain the respnse to each 'value' response for a given item but the issue is within one single form there are 60 value responses.  I feel I may need to use a combination of parse and compose a few times to get the desired output but everytime i gain a little bit of headway I hit a wall again (I am very new to JSON)

    I have attached the Json output for two forms results - hoping someone will be able to get a look and see if they can help me out :)

    ------------------------------
    Roisin Conlon
    ------------------------------

    Attachment(s)

    txt
    json1.txt   22 KB 1 version


  • 2.  RE: Complicate JSON

    Top Contributor
    Posted Apr 09, 2021 01:44 AM
    That's a beast of a response alright. You'll need to do a lot of filter array actions and then compose to pick out the first element of the output of the filter.

    You can process the responses in an Apply to each loop where the "results" element of the response body is the input

    Within there you can select elements with Filter array

    E.g to get the email address, filter items('Apply_to_each')?['items'] for item()?['id'] equals 94 and then get the value with first(body('Filter_array'))?['value']

    Some of the values are also an array (multiple selections?) Which you would need to either filter for, or select and join depending on what you need to do.

    Big project for someone new to this. Good luck. You'll figure it out.

    ------------------------------
    Will Page
    Technical consultant
    Christchurch, NZ
    ------------------------------



  • 3.  RE: Complicate JSON

    Posted Apr 15, 2021 03:30 AM
    Hi WIll

    Thanks for the feedback, luckily for me in this scenario, I don't need to dig into the value arrays from the multiple choice fields for this specific report but no doubt I will in the future so when time permits I will dig in there a bit more.

    In the meantime you have given me a great steer and I really appreciate it.  I have had to work from the position key however due to the existense if another id key at the top level of the Json outout but I am now getting the values written back to sharepoint and a sql table so thank you.  Fair bit of work still to do to get it right but wanted to reach out and say thanks for the help :)

    Cheers
    Roisin

    ------------------------------
    Roisin Conlon
    ------------------------------



  • 4.  RE: Complicate JSON

    Top Contributor
    Posted Apr 15, 2021 10:17 PM
    Glad to see you're getting on with it OK and thanks for taking to the time to respond on here to say so.

    ------------------------------
    Will Page
    Technical consultant
    Christchurch, NZ
    ------------------------------