mabhavsa
(Manan Bhavsar)
January 26, 2024, 10:33am
1
Hi members
Greeting of the day.
Please help me to resolve this issue as I have explored the developer forum but didn’t get the information.
I am currently working on one DateMath transform but unable to get the required output.
Requirement:
Input :
End Date: 7/6/2023 0:0:0 AM UTC
Output :
7/5/2023 (One day before the End date)
Developed Transform:
{
"id": "a16424f8-05f0-4f09-9642-b51e9ad266d8",
"name": "Date Math Transform",
"type": "dateMath",
"attributes": {
"expression": "+12d/d",
"roundUp": true,
"input": {
"attributes": {
"input": {
"attributes": {
"sourceName": "SAP HR DB- DEV (SAPUsers)",
"attributeName": "FiredDate"
},
"type": "accountAttribute"
},
"inputFormat": "MM/dd/yyyy HH:mm:ss a Z",
"outputFormat": "PEOPLE_SOFT"
},
"type": "dateFormat"
}
},
"internal": false
}
sjoyee
(Jo Yee Siang)
January 26, 2024, 2:24pm
2
Hi @mabhavsa , as mentioned in this documentation - Date Math | SailPoint Developer Community , the input datetime value must always be in ISO8601 format. However, seeing from your script, I see you are applying the dateMath
operation on the PEOPLE_SOFT format from the input value.
I have tweaked the script as follows:
{
"name": "Date Math Transform",
"type": "dateFormat",
"attributes": {
"input": {
"attributes": {
"expression": "-1d",
"input": {
"attributes": {
"input": {
"attributes": {
"sourceName": "SAP HR DB- DEV (SAPUsers)",
"attributeName": "FiredDate"
},
"type": "accountAttribute"
},
"inputFormat": "MM/dd/yyyy HH:mm:ss a Z",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
}
},
"type": "dateMath"
},
"inputFormat": "yyyy-MM-dd'T'HH:mm",
"outputFormat": "PEOPLE_SOFT"
}
}
In this script, I have done the following:
Format the FiredDate
value to ISO8601 date format
Apply "-1d"
dateMath
operation on the formatted date from #1
Format output from #2 to PEOPLE_SOFT date format
Note: yyyy-MM-dd'T'HH:mm
is always the output format of any dateMath
operation.
Hope this helps.
mabhavsa
(Manan Bhavsar)
February 9, 2024, 11:41am
3
Thanks @sjoyee . That worked.
1 Like
system
(system)
Closed
April 9, 2024, 11:42am
4
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.