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.
Solved! Go to Solution.
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.
(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:
Best Regards,
Wearsky
Can anyone help me figure out how to do this?
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.
(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:
Best Regards,
Wearsky