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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,610)