Forum Discussion
how to Dynamically set connection GUID from variable array
- 4 months ago
the real issue is connection GUID field simply does not support dynamic expressions in Fabric
Try this plz
after your foreach, add a Set Variable activity and do:
@variables('pl_metadata')[0].copy_job_connection_id
store it in a simple string variable, then use that in Copy activity
ir try skip the append variable altogether and just reference lookup output directly in your set variable
the issue is your array is actually not an array, its a single object so [0] wont work here
try this:
@variables('pl_metadata').copy_job_connection_id
or
@variables('pl_metadata').value.copy_job_connection_id
but honestly one more thing , connection GUID field in Copy Data activity is very strict, it doesnt always accept dynamic expression there, Microsoft has this limitation in many places
Thanks for the response.
I attempted both and received the following errors:
@variables('pl_metadata').copy_job_connection_id
Error:
microsoft fabric The expression 'variables('pl_metadata').copy_job_connection_id' cannot be evaluated because property 'copy_job_connection' cannot be selected. Array elements can only be selected using an integer index.
@variables('pl_metadata').value.copy_job_connection_id
Error:
The expression 'variables('pl_metadata').value.copy_job_connection_id' cannot be evaluated because property 'value' cannot be selected. Array elements can only be selected using an integer index.
I see that my object is uing { }, which means its an object and not an array. Thus I see what you mean. So Data factory thinks it is dealing with an array, because I have stored this object as a variable array using the append variable activity. But it is in fact an object?! I'm not sure how to proceed.
- nilendraMS4 months agoRegular Visitor
the real issue is connection GUID field simply does not support dynamic expressions in Fabric
Try this plz
after your foreach, add a Set Variable activity and do:
@variables('pl_metadata')[0].copy_job_connection_id
store it in a simple string variable, then use that in Copy activity
ir try skip the append variable altogether and just reference lookup output directly in your set variable