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

Parse outputs('Get_items_2')?['body/value']

Hello, so I've got a Get List with a filter that should give me only 1 result.... I then use a condition with 

length(outputs('Get_items_2')?['body/value']) and the in the "yes" condition, I want to edit the found item....
 
I do another loop through the items (always 1), the id corresponds to an ID column, but not the real unique value...
but If I send the whole body/value though email i see the real ID... how can I parse and access it?
 
[{"@odata.etag":"\"1\"","ItemInternalId":"35","ID":35,"Title":"Template Catalog","Environment":"CoE (envcoe)","Id0":"/providers/Microsoft.PowerApps/scopes/admin/environments/6fc55xx7-846f-xx4-a59f-1dda05xx01b4/apps/fcc5xxf1-cx95-4fxa-a9x0-9bbxxxxxxxe367","Creator":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|user@domain","DisplayName":"Diego...
 
How do I access ID and Id0 ??
 
Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resident Rockstar
Resident Rockstar

Re: Parse outputs('Get_items_2')?['body/value']

@diegochb79 

 

Hey Mate,

 

Can you give my expression a try:

 

outputs('Get_items')?['body/value'][0]['Title']

 

Please make sure the Field in not empty or this will give an error. 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
Highlighted
Dual Super User III
Dual Super User III

Re: Parse outputs('Get_items_2')?['body/value']

Diego

You should be able to select them from dynamic content menu. If not, try with the following WDL expressions:

item()?['ID']

item()?['Id0']

If none of these approaches work as expected, please share a screenshot with your current flow design

Ánimo!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper I
Helper I

Re: Parse outputs('Get_items_2')?['body/value']

Thanks! So in my first try I'v got this:

InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)' inputs at line '1' and column '2802': 'The template language expression 'outputs('Get_items_2')?['body/value']?['ID']' cannot be evaluated because property 'ID' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

diegochb79_0-1600432491729.png

 

The condition contains: (and it works ok)

length(outputs('Get_items_2')?['body/value'])

 

So I tried in the email with these two expressions:

ID 
outputs('Get_items_2')?['body/value']?['ID']

Id0
outputs('Get_items_2')?['body/value']?['Id0']
Highlighted
Dual Super User III
Dual Super User III

Re: Parse outputs('Get_items_2')?['body/value']

Hi!

So let's imagine length is equal to three, so your flow will execute the true branch of Your condition action block.

Now, you need to add an 'Apply to each' inside this true branch, assign as its input 'Get items 2' value output. Now, inside your new apply to each you can place the 'Send an email action block'

and you can use the following expression

 

item()?['ID']

 

 

But please note with the approach I am suggesting your flow will send 3 emails, since length was 3. So if lenght is 500, your flow will send 500 emails. Is this the behaviour you expect?

Thanx!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper I
Helper I

Re: Parse outputs('Get_items_2')?['body/value']

Thanks! yes... I was trying to avoid the foreach since the result will always be 1 in the list but I guess I will have to use it.

Highlighted
Resident Rockstar
Resident Rockstar

Re: Parse outputs('Get_items_2')?['body/value']

@diegochb79 

 

Hey Mate,

 

Can you give my expression a try:

 

outputs('Get_items')?['body/value'][0]['Title']

 

Please make sure the Field in not empty or this will give an error. 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: Parse outputs('Get_items_2')?['body/value']


@diegochb79 wrote:

Thanks! yes... I was trying to avoid the foreach since the result will always be 1 in the list but I guess I will have to use it.


Now I understand! Thanx for the clarification and congrats for solving the issue! @CFernandes suggestion was really appropriate for your needs

Good job and, Happy Flowing!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,222)