cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sinnamora
Helper I
Helper I

Data Structure not linear

Hi everyone,

 

I need to read 2 infos from an API.

I build the flow with HTML - Compose - Parse JSON but the response of API is not linear.

The structure is like this:

                {
                    "dirty"false,
                    "displayName""RecID",
                    "fieldId""BO:944e02d8537d17b3384143451180f87eda564c5798,FI:944e02da60578af7d7bc4644b6ae07ed4eb2648fc3",
                    "fullFieldId"null,
                    "html"null,
                    "name""RecID",
                    "value""946409e58a0cd978dad85c439cbe8f7732834fc9e0"
                },
                {
                    "dirty"false,
                    "displayName""Created Date Time",
                    "fieldId""BO:944e02d8537d17b3384143451180f87eda564c5798,FI:944e02da60ad493eb8d4904384b4b5f3e4fd01e675",
                    "fullFieldId"null,
                    "html"null,
                    "name""CreatedDateTime",
                    "value""8/18/2020 3:09 PM"
                }
File with response: LINK
 
I need to get the value from 2 parameters named SAPCliente and AccountManager.
 
Is it possible? Any suggestions?
 
Thanks for your help.
 
Silvia Innamorati
1 ACCEPTED SOLUTION

Accepted Solutions
Caspar_Rubin
Solution Supplier
Solution Supplier

Hey,

 

maybe there is an easier way but you could do it like this:

 

Full Flow:

 

2022-10-21_14h40_16.png

 

***

 

Explanation

 

First, after your Parse JSON action, create two new variables (initialize variable action). Called SAPCliente and AccountManager. Both empty strings.

 

Caspar_Rubin_0-1666356149806.png

 

 

Then add two nested Apply to each loops and select the dynamic content responses and fields (from the Parse JSON action) as their "output".

Caspar_Rubin_1-1666356225749.png

 

 

Then, add two Condition actions.

 

On the left side, use the Dynamic content name, as operator set it to is equal to and on the right side enter the text SAPCliente for the first Condition and AccountManager for the second Condition.

 

Then inside the If yes sections, add the Set variable actions. Select SAPCliente inside the first If yes section and Account Manager in the second If yes section.

 

As Value, put the Dynamic content value.

 

Caspar_Rubin_2-1666356520402.png

 

***

 

Test / Check

 

Result Compose action at the very end of the flow to check if it works:

 

Caspar_Rubin_5-1666356625574.png

 

 

When the flow ran:

 

Caspar_Rubin_4-1666356581272.png

 

hope this helps... 

 

cheers

 

 

 

 

View solution in original post

2 REPLIES 2
Caspar_Rubin
Solution Supplier
Solution Supplier

Hey,

 

maybe there is an easier way but you could do it like this:

 

Full Flow:

 

2022-10-21_14h40_16.png

 

***

 

Explanation

 

First, after your Parse JSON action, create two new variables (initialize variable action). Called SAPCliente and AccountManager. Both empty strings.

 

Caspar_Rubin_0-1666356149806.png

 

 

Then add two nested Apply to each loops and select the dynamic content responses and fields (from the Parse JSON action) as their "output".

Caspar_Rubin_1-1666356225749.png

 

 

Then, add two Condition actions.

 

On the left side, use the Dynamic content name, as operator set it to is equal to and on the right side enter the text SAPCliente for the first Condition and AccountManager for the second Condition.

 

Then inside the If yes sections, add the Set variable actions. Select SAPCliente inside the first If yes section and Account Manager in the second If yes section.

 

As Value, put the Dynamic content value.

 

Caspar_Rubin_2-1666356520402.png

 

***

 

Test / Check

 

Result Compose action at the very end of the flow to check if it works:

 

Caspar_Rubin_5-1666356625574.png

 

 

When the flow ran:

 

Caspar_Rubin_4-1666356581272.png

 

hope this helps... 

 

cheers

 

 

 

 

It works!

Thank you so much 😁

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (7,013)