cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dhinesh28R
Post Prodigy
Post Prodigy

How to get ID from filter array elements?

Hi all, 

In my i need to give a Id value lookup field. in my app i have so many lookup field values.

Go its getting exceed number of apply to each value.

So i am thinking to get a ID from filter array values.

But its getting error.

 

Following is my error,

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

 

Now i need to get a ID value form filter array elements.

 

How to resolve this issue?

 

Thanks,

Dhinesh.

2 REPLIES 2
DamoBird365
Microsoft
Microsoft

Hi @Dhinesh28R 

 

Based on your error, you are possibly looking for first(body('Filter_array_6'))?['Value']?['ID']

 

Without seeing your JSON, the error indicates that your Value is another Array of objects.  You can either use First to return the first Value object or ?[0] i.e. body('Filter_array_6')?[0]?['Value']?['ID'].

 

If ID is also an array of objects for each Value, you might have to contruct the following body('Filter_array_6')?[0]?['Value']?[0]?['ID'].

 

Damien

Hi @DamoBird365,

 

Thanks for your answer.

 

body('Filter_array_6')?[0]?['Value']?['ID'] - It's getting an empty values.

 

So i used first(body('Filter_array_6'))?['ID'] this. This getting ID only.

 

Thanks,

Dhinesh. 

 

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 (2,782)