cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
andrewp3283
Frequent Visitor

Formatting data from Select variable or Parse Json

HI

I have a flow that is getting data from two separate SP lists, one holds the Auditor information and the other holds the answers to the audit. the lists are connected by a reference number, i can get the data passed into flow when asking for a reference number, and when it generates the HTML the questions and answers are all coming out on one line, i can find where to format this to show the blow:

 

Current Output:

{"Question":"Where applicable has an F-10 been completed? is it readily available?","Answer":"Yes"},{"Question":"Where applicable is a CPHSP on site?","Answer":"Yes"},{"Question":"Is an up to date Health & Safety plan on site?","Answer":"Yes"},

 

Output Required:

Question: Where applicable has an F-10 been completed? is it readily available?

Answer:    Yes

Question: Where applicable is a CPHSP on site?

Answer:    Yes

Question:  Is an up to date Health & Safety plan on site?

Answer:    Yes

 

thanks for the help

3 REPLIES 3
Naveen_772
Resolver II
Resolver II

@andrewp3283  How this output is generated? I mean what is the format of the output is it String or an object?

 

Also, can you attach screenshots for your flow?

andrewp3283
Frequent Visitor

Hope this helps, the first Get Items retrieves the record based on the refno entered,  the second Get Items then gets the questions and answers from the Answer list again based on the refno entered.

 

The compose HTML in the Apple to each 2 "body" element takes the output from the Parse JSON

 

andrewp3283_0-1646324073706.png

andrewp3283_1-1646324107184.png

andrewp3283_2-1646324180309.png

andrewp3283_3-1646324201102.png

 

 

 

andrewp3283
Frequent Visitor

I have made some changes now but it is only exporting the first record not all of them, this is the Json for the parse Json in flow

 

{
    "type""array",
    "items":{
        "type""object",
        "properties":{
            "Question":{
                "type""string"
            },
            "Answer":{
                "type""string"
            }

        }
    }
}
 
it does what i want but on only the first record, i have this in a apply to each

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,315)