cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anthony_Dob
Continued Contributor
Continued Contributor

Acces a value property in for each value loop

Hi guys,

 

I have a scenario that I am retrieving N:N Intersect table data. It returns me all Training ID's from a Trainee. I want to do something for every Training I retrieve. Below the Value I am retrieving.

 

 

"value": [
            {
                "@odata.id": "https://orgdf039a58.crm4.dynamics.com/api/data/v9.0/cref8_opleiding_cref8_cursistset(db03e969-376d-ec11-8943-000d3a279af3)",
                "@odata.etag": "",
                "ItemInternalId": "db03e969-376d-ec11-8943-000d3a279af3",
                "cref8_opleidingid": "dc5e1cef-6ddc-488e-a973-a9ef1170eb76",
                "versionnumber": 6785275,
                "cref8_cursistid": "a08f8fda-f766-ec11-8f8f-000d3a2e7546",
                "cref8_opleiding_cref8_cursistid": "db03e969-376d-ec11-8943-000d3a279af3"
            },
            {
                "@odata.id": "https://orgdf039a58.crm4.dynamics.com/api/data/v9.0/cref8_opleiding_cref8_cursistset(138e859d-1367-ec11-8f8f-000d3a2e7546)",
                "@odata.etag": "",
                "ItemInternalId": "138e859d-1367-ec11-8f8f-000d3a2e7546",
                "cref8_opleidingid": "9ff81e43-3db7-41fd-9a06-b0fbb68ae569",
                "versionnumber": 6718200,
                "cref8_cursistid": "a08f8fda-f766-ec11-8f8f-000d3a2e7546",
                "cref8_opleiding_cref8_cursistid": "138e859d-1367-ec11-8f8f-000d3a2e7546"
            }
        ]

 

 

So I have a For Each loop on this value, but for some Reason I can only access cref8_opleiding_cref8_cursistid

2022-01-06 09_14_32-noest-trainingbudget-budgetrequest-logic - Microsoft Azure.png

 

I need the cref8_opleidingid instead. 

 

I tried this expression:

body('Get_Training_IDs')['value']['cref8_opleidingid']

 

Does not work though. How do you achieve this?

 

Best Regards,

Anthony

1 ACCEPTED SOLUTION

Accepted Solutions
Anthony_Dob
Continued Contributor
Continued Contributor

So i Added a Variable "Training Counter" which will increment in the For Each Loop. This way I can use this counter as an index to get the "cref8_opleidingid" I nee. I use the following expression in the loop.

 

body('Get_Training_IDs')['value'][variables('Training Counter')]['cref8_opleidingid']

 

This is my flow:

2022-01-06 10_00_04-noest-trainingbudget-budgetrequest-logic - Microsoft Azure.png

 

I can imagine their will probably be a much easier way for this to work. Please let me know.

 

Also I had to change the For Each loop settings to:

2022-01-06 10_02_00-noest-trainingbudget-budgetrequest-logic - Microsoft Azure.png

This will make sure the action in the loop happen sequentially.

 

Best Regards,

Anthony

 

View solution in original post

1 REPLY 1
Anthony_Dob
Continued Contributor
Continued Contributor

So i Added a Variable "Training Counter" which will increment in the For Each Loop. This way I can use this counter as an index to get the "cref8_opleidingid" I nee. I use the following expression in the loop.

 

body('Get_Training_IDs')['value'][variables('Training Counter')]['cref8_opleidingid']

 

This is my flow:

2022-01-06 10_00_04-noest-trainingbudget-budgetrequest-logic - Microsoft Azure.png

 

I can imagine their will probably be a much easier way for this to work. Please let me know.

 

Also I had to change the For Each loop settings to:

2022-01-06 10_02_00-noest-trainingbudget-budgetrequest-logic - Microsoft Azure.png

This will make sure the action in the loop happen sequentially.

 

Best Regards,

Anthony

 

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 (4,572)