Azure Data Factory - Capture error details of a dataflow activity -> Store into a variable -> Assign this variable to a dataflow parameter - azure-data-factory

I have a data flow and my requirement is to capture the error details into a variable when it fails and assign this variable to a parameter in the next data flow. I tried to achieve this until the second stage(With help) as below, but I'm unable to get this variable assigned to a parameter in the next data flow. The error I get is - Expression cannot be parsed
What do I do later?
This parameter is assigned to a column in the data flow and I use this column to update the table in the dedicated pool with the relevant error message.

I tried to reproduce the same in my environment and I got the same error
The above scenario fails, because dataflow fails to parse ' ' and / in your error message.
To resolve above error,please follow below steps:
I just create the error fail1 with message containing a different character.
Go to set variable : Create a variable and added dynamic content to the value.
#replace(replace(string(activity('Fail1').output.message),pipeline().parameters.quote,'"'),'\','/')
Output:
Updated:
Parameter

Related

Azure Data Factory, If Activity expression with array element

I have an array HeaderList with a list of names. I have a look up activity to look at a CSV file header. Then, I have a IF activity to compare the first element. the expression in If activity is like this:
#equals(activity('Lookup2').output.firstRow.Prop_0,variables('HeaderList')[0])
That does not work. If I change it to this:
#equals(activity('Lookup2').output.firstRow.Prop_0,'XYZ'), then it works. How do I reference an array element in expression?
Thanks
#equals(activity('Lookup2').output.firstRow.Prop_0,variables('HeaderList')[0])
What does it mean?
I have got the same error in the if condition activity. But when the pipeline is debugged, it did not throw any error. I have repro'd the same in my ADF environment. Below are the steps.
Lookup activity is taken, and it refers to a csv file.
An array variable 'HeaderList' is taken and values for the variable is set using set variables activity.
Then If Condition activity is taken and below expression is given as a dynamic content.
#equals(activity('Lookup1').output.firstRow.prop_0,variables('HeaderList')[0])
The same error is produced.
Error: Cannot fit unknown into function parameter any.
When pipeline is debugged, it did not throw any error. It is successful.

Power Automate Cloud - OneDrive When a file is created Trigger Condition

I'm using the OneDrive when a file is created trigger in my flow. I want to set a trigger condition that will only trigger if the file type is .xlsx
I tried the following condition:
#contains(triggerOutputs()?['headers/x-ms-file-name-encoded'], 'xlsx')
I get the following error:
InvalidTemplate. Unable to process template language expressions for trigger 'When_a_file_is_created' at line '1' and column '37225': 'The template language function 'endswith' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#endswith for usage details.'.
I did some research on-line and it appears to be due to the OneDrive dynamic selector "File name" being encoded, but I wasn't able to find any solutions for working around this issue.
Any help is greatly appreciated
Thanks
You can use the base64tostring function to turn it into a readable string.
Try an trigger condition expression like below
#endswith(base64tostring(triggerOutputs()?['headers/x-ms-file-name-encoded']), '.xlsx')

How to set expression for Until activity in Azure Data Factory? - String does not match

I'm trying to execute Azure Durable Function in ADF.
I have "Get Current Function Status" Activity inside Until activity.
Possible value are pending, completed, running and exception.
I wish to execute Until runtimeStatus Completed or Exception is reached.
It this possible to do following way or should I create flag variable?
I try to set expression, but getting warning "String does not match" :
or(equals(activity('Get Current Function Status').output.runtimeStatus,'Pending'),
equals(activity('Get Current Function Status').output.runtimeStatus,'Running'))
Can you try the below expression, there are few tweaks.
#or(equals(activity('Azure Function').output.runtimeStatus,'Pending'),equals(activity('Azure Function').output.runtimeStatus,'Running'))

how to add dynamic content for ADF datafactory

I want to add dynamic parameter for my ADF pipeline. I have 2 parameter and i want to concat with '/'.
1. My source folder-> pipeline().parameters.sourcefolder
2. My source file-> pipeline().parameters.sourcefile
I have tried this dynamic parameter. but i am getting error.
#concat{(pipeline().parameters.sourcefolder,'/',(pipeline().parameters.sourcefile)}
but is giving me error. Can you please help me.
Since you already have the two parameter , I suggest you define the variable and use the "Set variable" activity and concatenate the parameters there .I have the Fname & Lname as the defined parameter and the below expression should work fine .
#concat(pipeline().parameters.Fname,'/',pipeline().parameters.Lname)

Talend component tPivotToColumnsDelimited generates error "The method parseObject(String) is undefined for the type Object"

I am using the component tPivotToColumnsDelimited in Talend 6.1.1. When I try to run the job I get the error message "The method parseObject(String) is undefined for the type Object".
In code view I can see the error relates to this line of Talend-generated code:
sumtPivotToColumnsDelimited_1 = Object.parseObject(row3.Amount + "")
As you can see from the process flow above, the data comes from an SQL query. The schema flowing into the tPivotToColumnsDelimited looks like this:
The tPivotToColumnsDelimited component settings look like this:
Any suggestion how to fix it?
Its clear that Talend cannot parse an Object typed variable, You need to change the type of column Ammount to other type like int, float.