Forum Discussion
Hi, can anyone suggest me a workaround, please?
- bojanvelevski3 years agoValued Contributor
Hi @amit.saroha,
The values that are passed from parameters, are always a string. So in your case, you’re not passing a function, but a string.
In order your pipeline to work is, either leave the BatchParameter to get the date directly from the pipeline execute like shown on the picture above, or, use the eval() function with the parameter.
eval(_Effective_Date)That way your function passed like a parameter, will be evaluated and considered as a function.
Hope this helps,
Bojan- amit_saroha3 years agoNew Contributor III
Thanks @bojanvelevski - It works but when I pass 2022-11-20 in same parameter instead of expression the eval (Effective_Date) returns 1991 but I need it as it is 2022-11-20.
Please suggest if there is a way to do it, I want both the options working.
- bojanvelevski3 years agoValued Contributor
Tell us more on the use case. You have situation where sometimes the date should be current timestamp and sometimes just a date?
If yes, what is the condition?
You can pass an enhanced expression like :
CONDITION ? Date.now() : '2022-11-20'and wrap this in eval() in the snap itself.