Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Setting value of date interface tool with the API

slongstreet
6 - Meteoroid

I'm trying to bring an Alteryx analytics app on our server into a panel in Salesforce so my reps don't need to bounce between multiple tools. 

 

The challenge I'm having appears to be related to the user interface date tool. I'm either passing the parameter wrong or I need to maybe create an API version of the app that doesn't use it. Has anyone encountered this before? Also, is there a good resource describing the different parameter types for the API that would help me troubleshoot these things ongoing?

Error: 'The entered date () is invalid'

 

Approach:

  • Step 1:  Pass the workflow_id and parameters to v1/workflows/{workflow_id}/jobs/ to add the job to the queue
    • This is where the error happens, details below
  • Step 2: Check on completion after 10 seconds then every 10 seconds until it's complete using v1/jobs/{job_id}/
    • Currently just using to retrieve error messages 
  • Step 3: Haven't started but believe the outputs will give me the id to use /v1/jobs/{id}/output/{outputId} to retrieve the file generated

 

Extra context.The app takes in a name, product list, start and end date. Using v3/workflows/{workflow_id}/questions  I pulled in the question details for the parameter below

 

{'name': 'Start_Date',
  'questionType': 'QuestionDate',
  'description': 'Select Beginning of Period',
  'value': None,
  'multiple': False,
  'items': []}

 

I believe the format I should be passing for the parameter in the payload under questions is this format but I've tried a couple. 

{
'Name': 'Start_Date',
'value': 'yyyy-mm-dd'
},

4 REPLIES 4
slongstreet
6 - Meteoroid

Circling back to this one. I hit my head against it too long then tested using the text input tool and it's working wonderfully. It's an extra step to create a power-user ready analytics app and a second version that strips out the user interface tools for text input, but it works wonderfully.

If anyone ever solves this - let me know. I'd much rather not have an extra step!

patrick_digan
17 - Castor
17 - Castor

@slongstreet What version of designer/server are you running? I'm on 23.2 and the Date tool is working as expected via api. I'm attaching a simple example where my date tool is named DT. For my payload, I used a line of code like this when running the api: 

{"questions": [{"name": "DT","value": "2025-01-01"}]}

Your payload looks comparable, so I'm a little stumped why it's not working. It seems like there is either a bug going on or some sort of a small typo (which seems unlikely if you're getting the text box to work). 

slongstreet
6 - Meteoroid

@patrick_digan - I'm angry at myself. Given your note I went back and commented out all parameters and started reassembling. While the errors were still showing the same as the above for the date being invalid, the issue was how I formatted my listbox parameter. I updated it and everything is working as expected.

 

Thanks for the nudge!

patrick_digan
17 - Castor
17 - Castor

@slongstreet Been there plenty of times before myself! Glad you got it sorted out.