โ03-12-2021 02:42 AM
Iโm calling a child pipeline to do an insert
Iโm passing a datetime field, but in the child parameter it is now a string
How do I convert it back to datetime?
In the parent before I execute the child the value is:
1996-08-26T00:00:00.000
In the child, the value is: (Iโve saved to a string field to test)
{โ_snaptype_localdatetimeโ:โ1996-08-26T00:00:00.000โ}
How do I convert this back to a date?
Iโve tried Date.parse(_StartDate) and it doesnโt recognise the parameter value as something that can be converted to a date
โ03-12-2021 04:21 AM
โ03-12-2021 04:58 AM
You can try with the following expression in the child pipe:
Date.parse(JSON.parse(_StartDate))
Or to avoid sending the string {โ_snaptype_localdatetimeโ:โ1996-08-26T00:00:00.000โ} to the child pipeline, from the parent pipeline try to send the date field(StartDate) as a string(not as a datetime), and then try to convert to date with Date.parse(_StartDate).
Regards,
Spiro Taleski
โ03-12-2021 05:28 AM
Iโve tried both of those, and each time it errors as not a number error
We managed to build a work around though, buy setting up some snaps to except the values as part of the incoming document rather than passing a parameter
Thanks for the help