Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/16/2024 12:48 AM - edited 07/16/2024 12:51 AM
Hello everyone,
I'm working on a requirement and would appreciate some advice or alternative approaches. Here is the logic I'm trying to implement:
I've considered using the following URL pattern to fetch the data in the ImportUserJSON code in the HCM connection:
"url":"https://example${#if(${date:format('E')} == 'Sun')?'':'?$filter=TmstpDate eq ' + ${date:format('yyyyMMdd', ${date:add(-1)})}}"
I am not sure if this approach is supported in this case. Is there a different way or a better approach to achieve this requirement?
Any suggestions or recommendations would be greatly appreciated!
Thank you!
07/16/2024 04:45 PM
07/17/2024 01:29 AM
It didn't work so i tried again to use this method by adding this to my ImportUserJSON:
"javascript": {
"beforeExecution": "let today = new Date();\nlet dayOfWeek = today.getDay();\nif (dayOfWeek === 0) {\n this.url = 'https://example';\n} else {\n let yesterday = new Date(today);\n yesterday.setDate(today.getDate() - 1);\n let formattedDate = `${yesterday.getFullYear()}${('0' + (yesterday.getMonth() + 1)).slice(-2)}${('0' + yesterday.getDate()).slice(-2)}`;\n this.url = `https://example?$filter=TmstpDate eq '${formattedDate}'`;\n}"
}
the connection worked after running the Job, but now i am not sure how to actually tell which users were updated or how to find out that the filtering method of this javascript to calculate the URL before making the request worked?
07/17/2024 03:26 PM
Does target application support filter !
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️