Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to use the Date interface tool?

jedwards543
6 - Meteoroid

I am trying to use the interface tool for the first time. I would simply like to be able to manually select a date when I run the file. I would like that date to then be entered as the value of a variable.

 

Currently, I am only able to change the name of the variable to the selected date instead of the changing the variable values themselves.

 

file.PNGHere is a photo of my file (it is attached as well).

 

 

 

 

 

 

 

 

 

 

date.PNGI would simply like to change the "Date" variable from "dummy" to the date selected in the date interface tool. I have tried changing the data type to datetime, but it only works with string. It throws an error otherwise. Not sure why.

 

 

update.PNG

 

When selecting "expression" (as currently in the photo), it changes the name of the variable ("Date") to the date selected in the interface tool (ex "2017-05-11"). When I select "field" it changes the value of the variable from "dummy" to "2003." I have no idea where it is getting 2003 from. I would like to change the value of the variable from "dummy" to the date selected in the interface tool (ex "2017-05-11").

 

Any help is appreciated!

 

 

10 REPLIES 10
patrick_digan
17 - Castor
17 - Castor

@jedwards543 So close! It looks like the date input interface tool doesn't pass quotes. You can verify this for yourself by using the interface designer (View>Interface Designer) and selecting the second option (test view) and then open debug. I got something like this:

 

Capture.PNG

You can see that you really want "2017-05-11" with quotes. To resolve this, I would change your action tool to replace a specific string at the bottom:

Capture.PNG

 

That should do the trick. If you want an alternate and undocumented method that I prefer, then I would change my formula tool to:

 Capture.PNG

I had to rename the interface tool to Date (click on the tool, then click on the annotation button Capture.PNG and change the name). If you click back on your canvas and then go to the workflow configuration tab, you can now set a test value there and can hit run like a workflow to pass the variable. When you run it as an app, that test value is completely ignored and the user input is instead passed. This method is great because it requires no action tools, and allows you easily send test values through there.

 

Let me know if you have any questions!

JessicaS
Alteryx Alumni (Retired)

Hello,

 

This post has been moved to Publishing & Gallery for greater visibility.


Thanks!

Jess Silveri
Manager, Technical Account Management | Alteryx
jedwards543
6 - Meteoroid

Thank you! It worked.

 

workflow.PNGI do have one follow up question. When I go to the workflow configuration tab, the picture to the right is what I see. I do not see a "test value" option. What am I doing wrong?

 

Thank you!

patrick_digan
17 - Castor
17 - Castor

EDIT: I see you got it working on your own!

@jedwards543 I'm attaching a working example. My guess is that in your action tool you're including the quotes ("%Question.Date%") and should be excluding the quotes (%Question.Date%). I could be wrong though. Using the interface designer and open debug may help illuminate the situation.

 

For your picture, I was being loose with my terminology :) The three columns are are type, name, and value. The type and name are used to call the object (like %type.name%, which in our case is %Question.Date%). The value is used when running as a workflow (it's replaced by the user input value when running as an app). So from that screen you can type in 2017-05-11 like this and run it as a workflow to see how it works:

Capture.PNG

 

jedwards543
6 - Meteoroid

Ah I see! Thank you for your quick response and helpful insight!

Fz
8 - Asteroid

Hello,


I try to do some workflow. My initial file have two colomns : Initial-date and end date. I would like to be able to manually select a end and initial date when I run the file. I would like that end and initial date be entered as the value of a variables.

It's work but i need that the end date is written in the cell B2 and initial date in the cell A2.

 

I join the screenShot of the present result and also my woorkflow 

 

Captur.PNGCapture.PNG

 

Thank you for your help in advance

Srazvi90
5 - Atom

I'm trying to do something very similar. I have a hard coded date in the formula tool. I'm trying to have the user update the date to whatever they want. My current Action tool configuration is not allowing me to do that. What am I doing wrong?

Formula tool with hard coded dateFormula tool with hard coded dateAction tool configured to "Replace a specific string"Action tool configured to "Replace a specific string"

BenMoss
ACE Emeritus
ACE Emeritus
Well the date being passed into the interface tool will be in YYYY-MM-DD format so you might be getting a conflict because you are then running a dateparse against that when actually it's already in the correct date format.
Srazvi90
5 - Atom

Got it, date parse was the issue and removing it resolved the issue! Thanks.Updated formula without date parse. I removed the Action tool and it seems to work.Updated formula without date parse. I removed the Action tool and it seems to work.

Labels