Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Passing dates as parameters in json payload in Alteryx designer

narula8
7 - Meteor

Hello Team,

Can we have ideas to pass dates as parameters in json in Alteryx designer.

 

Sample json below :

 

{
"report": "ABCD",
"reportingEngine": "PLATFORM",
"timeField": null,
"startTime": 1688149800000,
"endTime": 1688668199999,
"timeZone": "Asia/Hyderabad",
"page": 0,
"pageSize": 10,
"filters": [
{
"dimensionName": "SN_MESSAGE_TYPE",
"filterType": "IN",
"values": [
"2"
],
"details": {
"type": "DIMENSION"
}

 

We can to startTime and endTime as parameters.

2 REPLIES 2
narula8
7 - Meteor

Sorry, typo here . 

We can to pas  startTime and endTime as parameters in json payload 

DataNath
17 - Castor
17 - Castor

Hey @narula8, in the option above what you have selected in your screenshot, you can see that there is a 'Take Query String/Body from Field' option. If you hit this then we can build the JSON beforehand in a Formula tool - you just need to split the expression into several parts and put a ToString(<Start/End>) field where they belong. You can see how I've gone about this in the workflow attached. I've noticed that you're using an extended epoch time which is ms since January 1st 1970 so if you're starting with raw dates you'll need to do a calc like the following and then plug this into where the ToString() instances are:

 

DateTimeDiff(<DateField>,'1970-01-01 00:00:00','ms')

 

 

Labels
Top Solution Authors