cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ash2
Level: Powered On

using Get Item to update fields

Hi All, 

 

I'm new to the Microsoft flow so sorry in advance if I get some of the terminology wrong and your help is appreciated

 

I have two lists, list A that consists of user information and what location they are assigned and list B consist of action that needs to happen at a given location (a common field in both is Location). 

 

what I m trying to do when an item is created in List B, how would I get the user information from list A to update in List B? 

 

when every I use  Get-Item I cant seem to get the ID from the location List. 

 

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: using Get Item to update fields

 

@Ash2 

 

odata syntax is different

 

Use

 

Title eq 'triggerBody()?['IncidentLocation']'

 

where  triggerBody()?['IncidentLocation'] is expression

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

8 REPLIES 8
Dual Super User
Dual Super User

Re: using Get Item to update fields

Hi @Ash2 

 

Get item action will require you to have the ID value for the item you are looking for

Since in this case you do not know the ID, Get item is not the right option

 

Use GetItems action to query your list A based on the data obtained from the list B tirgger (when an item is created)

 

when using GetItems to query your list A, you can spiecify your filter criteria

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ash2
Level: Powered On

Re: using Get Item to update fields

Hi @RezaDorrani 

 

Thank you for your replay, 

 

should i be doing the query in the Get Items action  "@equals(items('Apply_to_each')?['Title'], triggerBody()?['IncidentLocation'])"  or do I need to apply this in a filter array?

 

get items.png

Dual Super User
Dual Super User

Re: using Get Item to update fields

Hi @Ash2 

 

performing query in getitems is better since you only get the data you need

this query is odata query

 

You could also use filter items to filter the results later, but performance wise first option is better

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ash2
Level: Powered On

Re: using Get Item to update fields

Hi @RezaDorrani 

 

when i use the syntax  @ equals(items('Apply_to_each')?['Title'], triggerBody()?['IncidentLocation']) to the filter Query its giving me the below

 

The template validation failed: 'The inputs of template action 'Get_items' at line '1 and column '1686' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Get_items' to be referenced by 'repeatItems' or 'items' functions.'.
Dual Super User
Dual Super User

Re: using Get Item to update fields

 

@Ash2 

 

odata syntax is different

 

Use

 

Title eq 'triggerBody()?['IncidentLocation']'

 

where  triggerBody()?['IncidentLocation'] is expression

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Ash2
Level: Powered On

Re: using Get Item to update fields

Hi @RezaDorrani 

 

thank you every much for the help. 

 

so Title eq 'triggerBody()?['IncidentLocation']' didnt work for some reason but when i changed it to Title eq '@ {triggerBody()?['IncidentLocation']?['Value']}' it was working fine

Dual Super User
Dual Super User

Re: using Get Item to update fields

Hi @Ash2 

 

IncidentType probably is a complex type column

choice or lookup

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Ash2
Level: Powered On

Re: using Get Item to update fields

@RezaDorrani 

 

thank you for the replay, the below worked perfectly


@RezaDorrani wrote:

 

@Ash2 

 

odata syntax is different

 

Use

 

Title eq 'triggerBody()?['IncidentLocation']'

 

where  triggerBody()?['IncidentLocation'] is expression

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly



.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,045)