I am calling a SOAP service using integration objects; then using xmltojson() plug-in function and a!fromJson() function to retrieve the data in dictionary style.
I am storing this data into a CDT and when doing so, the date fields are NULL even though the web service is returning data. The problem is I need to transform the XSD DATETIME fields into an Appian DATE object. In the figure below you can see the format in which I get the data from SOAP web service. How do I transform an XSD DATETIME into an Appian DATE object?
Discussion posts and replies are publicly visible
use this in expression rule pass the date via rule input and keep the data type to text
with( local!splitedDateandTime: split( ri!jsonDateText, "T" ) ,
local!dateInJson: split( split( local!splitedDateandTime[1], "-" ), "-" ), local!timeInJson: split( split( local!splitedDateandTime[1], "-" ), ":" ), gmt( datetime( local!dateInJson[1], local!dateInJson[2], local!dateInJson[3], local!timeInJson[1], local!timeInJson[2], local!timeInJson[3] ) ) )
Thank you. I will wait to see if anyone else has any other approach.
I have used this in multiple application
Which Appian version are you working with? This is the default ISO date time format. Appian since version 19.3 will automatically parse it via a!fromJson()
Hi,
You can store the xsd datetime which you are getting from the SOAP service as text value. Change the type of the datetime field to text in your cdt.
Once it is stored as text, you can convert it to required format in Appian or use it as it is.
If you donot want to store the value as text, you can convert the value to Appian readable format before saving the value to the cdt.
You can use a combination of split and todatetime functions to achieve this(convert the datetime to Appian format)
We are still on 18.4 but it is good to know that in 19.3 Appian is doing it automatically. Thanks Stefan.