cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
saturation
Resolver I
Resolver I

Need Help - Update a Row Keeps Adding Apply To Each

Using D365, trying to query all records on a custom table "Gear" to get a text "Name" field, then query the Account table (accounts) for the Account.Name field, then update the custom "Gear" Account lookup field with that GUID.

 

When I add the "Update a Row" and set the Account to the GUID, then it adds an additional "Apply to Each" which I don't want.

 

Should I be using another control instead of Apply to Each? How would I add a Do Until setting the number to the length of the number of returned records? To be clear, here's what I'm trying to do:

 

1) Get all rows on a custom entity.

2) Loop through the rows.

3) Get the text field "account name" and then query the Account entity for the name.

4) Update the custom entity "account" lookup field with the GUID from the Account entity.

 

 

flow.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @saturation ,

 

The text does not specify the 'companies' entity in your screenshot.

In addition, the 'apply to each' action is added automatically is because your action invokes the values in the array.

In your screenshot, 'Get Company Name' action returns an array. And 'Update a row' action invoke the value in this array. So it add 'apply to each' action  automatically.

vxiaochenmsft_0-1639982126100.png

 

(If there is only one object found in action 'Get Company Name', the result it returns is also an array, and the array has an object.)

 

If it returns one object array and you don't want to use 'apply to each' action , you could use

array[0]['ColumnName'] to get a value.

For example:

vxiaochenmsft_1-1639982288625.png

vxiaochenmsft_2-1639982305544.png

 

Best Regards,

Wearsky

 

 

 

 

View solution in original post

2 REPLIES 2
saturation
Resolver I
Resolver I

Can anyone help me figure out how to do this?

v-xiaochen-msft
Community Support
Community Support

Hi @saturation ,

 

The text does not specify the 'companies' entity in your screenshot.

In addition, the 'apply to each' action is added automatically is because your action invokes the values in the array.

In your screenshot, 'Get Company Name' action returns an array. And 'Update a row' action invoke the value in this array. So it add 'apply to each' action  automatically.

vxiaochenmsft_0-1639982126100.png

 

(If there is only one object found in action 'Get Company Name', the result it returns is also an array, and the array has an object.)

 

If it returns one object array and you don't want to use 'apply to each' action , you could use

array[0]['ColumnName'] to get a value.

For example:

vxiaochenmsft_1-1639982288625.png

vxiaochenmsft_2-1639982305544.png

 

Best Regards,

Wearsky

 

 

 

 

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!

Top Solution Authors
Users online (3,734)