Earlier today I was helping another developer understand an issue involving links using a urlwithparameters() function. They were experience an issue where a datetime passed as a query parameter was reading out one minute behind in the linked interface. When I investigated the issue I noticed that the query parameter was showing as a timestamp; however when I ran some small-scale tests I noticed when I passed datetimes as query parameters they were formatted appropriately (see screenshots for context). Ultimately what we discovered is that their use case they were passing two parameters, one an integer ID and the other the datetime. In my testing I was initially only testing with a datetime. When I included a similar integer parameter I was able to get the odd behavior to replicate. The solution for us was to cast the other parameters to strings. What is more interesting is that the behavior only occurs when the datetime is taken from a record. If I replace the datetime query param with a local variable or a datetime() function is works just fine and does not convert the datetime into a timestamp. My questions is whether or not this is expected behavior and if so then why?
a!localVariables( local!eventSchedule: 'recordType!{dc1b103d-69d8-42ae-b33f-ce537e281d61}CMGT_Event_Schedule'( 'recordType!{dc1b103d-69d8-42ae-b33f-ce537e281d61}CMGT_Event_Schedule.fields.{78f9f05d-8087-4e02-81a8-903d96225e71}startDateTime': now() ), local!dateTime: now(), { urlwithparameters( path: "https://dummy.path", parameterNames: { "param1", }, parameterValues: { local!eventSchedule['recordType!{dc1b103d-69d8-42ae-b33f-ce537e281d61}CMGT_Event_Schedule.fields.{78f9f05d-8087-4e02-81a8-903d96225e71}startDateTime'] } ), urlwithparameters( path: "https://dummy.path", parameterNames: { "param1", "param2" }, parameterValues: { 1, local!eventSchedule['recordType!{dc1b103d-69d8-42ae-b33f-ce537e281d61}CMGT_Event_Schedule.fields.{78f9f05d-8087-4e02-81a8-903d96225e71}startDateTime'] } ), urlwithparameters( path: "https://dummy.path", parameterNames: { "param1", "param2" }, parameterValues: { 1, local!dateTime } ), urlwithparameters( path: "https://dummy.path", parameterNames: { "param1", "param2" }, parameterValues: { tostring(1), local!eventSchedule['recordType!{dc1b103d-69d8-42ae-b33f-ce537e281d61}CMGT_Event_Schedule.fields.{78f9f05d-8087-4e02-81a8-903d96225e71}startDateTime'] } ) } )
Discussion posts and replies are publicly visible
Just reproduced on my end. Probably something you should log with Appian Support.
datestimes, decimals in particular do not fare very well in these scenarios in general.
IMO, it's always best to convert all parameters to normalized strings if you are using in a web API (either via query parameters or post body).