How to use timestamp type parameters set in pipeline with timestamp type in data flow - azure

I can't send the question due to some mysterious error, so I'll share a screenshot of the question.
Can anyone help me solve this?

I have reproduced the above and got same error when the Expression checkbox in checked.
Remove the Expression checkbox check in dataflow pipeline assignment and pass it as a string. Now it won't give the error.
It will take the Dataflow parameter like this.
Also, along with the Date time string pass the format in toTimestamp() function to avoid null values.
This is my sample input data:
sample filter condition:
toTimestamp(start_date,'yyyy-MM-dd\'T\'HH:mm:ss')
Filtered Result:

Related

error on formatdatetime on power automate

i just follow this instructions how to create weekly birthday reminder using power automate : https://powerusers.microsoft.com/t5/Building-Flows/Weekly-Birthday-Notification-for-newbie/m-p/1723027?lightbox-message-images-1723027=503163i3A49E010C4BF961F#M190930
the problem is i got error on filter arrays that said : The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.
please advice
i already tried adding string type on the syntax

ADF adding equals condition to existing if condition

I have an if condition in an ADF activity like below:
#if(
contains(activity('LookupWmkLastUpdateConfig').output,'firstRow')
,greater(
activity('LookupLastUpdateSrc').output.lastModified
,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark)
),
false)
The if condition looks as the last update date in src vs my database. Want I want to include is an additional block of code that evaluates an outside parameter called TypeLoad.
The current set-up only allows for full loads, I want to be able to include delta loads.
Does anyone know how to include such a piece of logic to the existing if code?
equals(pipeline().parameters.FwkItem['TypeLoad'],1)
The above condition would for example evaluate the full or delta load.
All help is very welcome.
Thanks!
I tried to repro this in my environment. I gave the same expression
#if(
contains(activity('LookupWmkLastUpdateConfig').output,'firstRow')
,greater(
activity('LookupLastUpdateSrc').output.lastModified
,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark)
),
false)
Same error function 'if' does not accept 2 arguments is occurred.
When the expression is looked into the reason for error, there were two closing parentheses near ,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark) ) .
Same is highlighted in the above image.
one parenthesis is removed and gave the expression as in below image.
#and(equals(pipeline().parameters.fwkitem,1),if(contains(activity('LookupWmkLastUpdateConfig').output,'firstRow'),greater(
activity('LookupLastUpdateSrc').output.lastModified
,activity('LookupWmkLastUpdateConfig').output.firstRow.NewValueWatermark)
,false))
Expression doesn't produce any error now.

Set variable in Azure data factory

I’m wondering if someone can help us out here as we are going round in circles.
In short we are trying to;
Read a value from a SQL table via a stored procedure in a lookup task.
We want to use that value to set a variable so we can use it in a copy data task.
However our set variable task using (#activity('Lookup1').output) returns the value but its wrapped in lots of JSON (see attached).
In the attached we are only interested in the TokenGUID value, not the rest of the JSON.
So can someone please point us in the direction of how we would set a variable to be a string value.
Thanks,
Nic
You can use this expression to get TokenGUID:
#activity('Lookup1').output.firstRow.TokenGUID
My test:
Output of Lookup activity
Output of Set variable activity

How to pass JSON into an Azure Function with embedded dynamic content in Azure Data Factory V2

In ADFv2 I'm looking up a date and passing it to an Azure Function. I can pass just the data like so:
#activity('GetLastDateProcessed').output.firstRow.LastDateProcessed
However if I embed this into a JSON string like this:
{"lastProcessDate":"#activity('GetLastDateProcessed').output.firstRow.LastDateProcessed"}
I get this {"lastProcessDate":"#activity('GetLastDateProcessed').output.firstRow.LastDateProcessed"} instead of {"lastProcessDate":"2019-11-13"} as input into function.
Last I've tried to use a parameter with no success also.
#concat('{"lastProcessDate":"', string(pipeline().parameters.lastProcessDate), '"}')
The problem here is the parameter was not set. I set the parameter like this:
#activity('GetLastDateProcessed').output.firstRow.LastDateProcessed
However this is a default value and is never dynamically updated. If I can update this string then the #concat method will work, but haven't been able to figure out how to dynamically update a parameter for the pipeline.
Another option could be a pipeline variable, but I don't know how to reference the variable.
How do I concat strings together with dynamic content?
I think what you are missing is that when you use the at-sign '#' in the json string you should follow it with a curly bracket '{'
In your example it will look something like this:
{"lastProcessDate":"#{activity('GetLastDateProcessed').output.firstRow.LastDateProcessed}"}
here is the source (found it in the comments):
https://azure.microsoft.com/en-us/blog/azure-functions-now-supported-as-a-step-in-azure-data-factory-pipelines/#:~:text=Azure%20Data%20Factory%20(ADF)%20is,in%20your%20data%20factory%20pipelines.
I was able to get this to work by creating a second pipeline. This is not optimal, but works for people running into this same issue. Hopefully someone finds a better solution than this!
From the first pipeline I set the second pipelines parameter with this:
#activity('GetLastDateProcessed').output.firstRow.LastDateProcessed
I named the parameter in the second pipeline lastProcessDate so then this worked:
#concat('{"lastProcessDate":"', string(pipeline().parameters.lastProcessDate), '"}')
This is not straight forward and can't be how Microsoft is expecting us to solve this!
I was able to achieve this with command.
{
"storedprocedure":"storedProcName",
"params":"#{variables('currentDt')}"
}

Azure data factory logical function expression invalid

I've got an ADF pipeline which is supposed to ETL job. I've added IF CONDITION which should evaluate the last result(of Copy Data Activity) obtained(If the output is Succeeded then true activity should be executed.). While writing the expression
I'm following the syntax but its failing in debugging.
What am I missing in the expression?
Further, I'll be evaluating output from Wait activity also since the output of Wait activity is {} how to evaluate the activity in the same way I'm evaluating Copy Data Activity?
I was having almost the same issue.
Please refer to the below post.
Solution
Not sure if you are still having a problem with this, but it appears that you have one too many parentheses.
#equals(activity('FS1 to Blob').output.status), 'Success')
^
So it would appear that equals() only has the activity output as input.
Get rid of that and try it then!

Resources