I have a requirement to generate a unique ‘guid’ for each row in the dataverse, and for that, I’m using an additional column in the copy activity as shown below.
Since it generates the same guid for every row, I’m trying to use a lookup and iterate through a "For Each" loop as shown below.
In the "For Each" loop, I’m using this expression to retrieve the values:
@activity('Lookup1').output.value
However, I’m encountering this error:
This is a sample output from the lookup activity: I’m using .csv file as the source
{
"firstRow": {
"Bill-to Customer Name": "****",
"Bill-to Customer No_": "****",
// ... (other fields)
"ProjectCustomer_FullName": "****",
"ProjectCustomer_ID": "****"
},
"effectiveIntegrationRuntime": "****",
"billingReference": {
"activityType": "****",
// ... (other billing reference fields)
},
"durationInQueue": {
"integrationRuntimeQueue": ****
}
}
How to resolve this issue ? Appreciate your help on this.
2
Answers
Can you please try
@activity(‘Lookup1’).output.firstRow.ProjectCustomer_ID
Here is an idea: add a set variable activity before the ForEach to directly set an example variable, lets say ‘CurrentGuid’ to a static value (e.g., a sample GUID from your Lookup output).
In the ForEach, use the CurrentGuid variable to access the GUID values using the expression @item().currentGuid. (The output from the Lookup activity should be mapped to a variable in the ForEach loop that you can then use to access the GUID values.)
This will help isolate whether the issue is with the Lookup activity’s output or with the way you’re accessing the variable in the foreach