Alteryx Designer Desktop Discussions

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

Using the Text Box Tool

lindsayhupp
8 - Asteroid

Hello!

 

I'm trying to use the Text Box Tool in the App interface.  I asking that a person enter a specific date (say 8/31/2021) and I want this static date to be entered in as its own column so that it is the same for all the rows in the file.  How do I do this?

 

Right now I have the Text Input Tool, but I think I'd rather set it up on the App interface as the date may change each time the workflow is run.

 

Thanks!

10 REPLIES 10
Luke_C
17 - Castor

The text input tool can be set to update the value in the text input to achieve this. You may also want to consider using a date input tool

Qiu
20 - Arcturus
20 - Arcturus

@lindsayhupp 
There is also a good sample along with the Date Input Tool, which you can check it.

Date.png

DataNath
17 - Castor

Would definitely recommend the date input tool as the others have suggested. If you then want this as a column of its own that is the same for every row in your current data source, just use the append tool which will attach one instance of this new date field to every row in your dataset.

lindsayhupp
8 - Asteroid

How do I use the append tool in this situation?  As I only have one set of data and I just want to add the date as it's own column I don't have a target data set and a separate source data set.  Thanks in advance!

 

DataNath
17 - Castor

I was thinking of a more long-winded way earlier, sorry! There wouldn’t actually be any need for an append tool. All you need to do is:

 

• Add a ‘date’ field using the formula tool - literally put any date in here (in YYYY-MM-DD format as Alteryx’s standard) as this will just act as a dummy

• Hook the date input interface tool up to the lightning bolt of the formula tool

• In the ‘action’ tool configuration, ensure that the date coming from your date input tool updates the value (I.e your dummy date) in the formula tool

 

Have a go and if you have any issues then I’d be happy to build out an example tor you using some dummy data - just let us know!

DataNath
17 - Castor

Had a little time spare so went ahead and built the example anyway. If you just click the file itself it'll just provide you with the prompt I've made and run as an app. To open it as the workflow itself to see what's happening and use it as a template, just navigate to the file from within Alteryx (File > Open Workflow > Browse) and open it that way.

 

DataNath_0-1654984164019.png

DataNath_0-1654987734613.png

 

 

lindsayhupp
8 - Asteroid

I'm sorry to be such a pain, but it doesn't seem to be working.  What I have is as follows:

1) Date input tool

2) Action tool (Update value Default)

3) Formula tool where I put 'Start Date' as the column header and then today's date in "" (so I put "2021-06-11").  Not sure the parentheses are correct, but I've also tried it without and it doesn't work.  

 

I've tried it a few ways (using different data types) and can't seem to get it to work.  I now get an error that states "The formula 'Start Date' results in a number but the field is date/time.  

 

Thanks!

DataNath
17 - Castor

Hey @lindsayhupp, are you able to share your configuration? I think the most likely issue is your action tool, as it seems like your formula is fine.

 

When you have made the dummy (in your case, '2021-06-11'), you'll want to navigate to @expression-value and select that, then below you need to select 'Replace a specific string' and remove the quotation marks from each end, so it just leaves 2021-06-11. You'll also want to ensure that you're definitely using the 'Date' data type when setting up your formula.

 

If this doesn't work, shoot over your workflow if possible and we can help resolve the issue!

 

The reason you need to exclude the quotations from this is that, when the user selects a date, Alteryx will (as the prompt suggests), replace that specific part of the formula expression with the selection and so if you leave them in there, they'll also get replaced. Therefore, let's say the user selects 2000-05-10 for example, that would now become the new formula and Alteryx sees this as you trying to create a number by literally doing 2020 minus 5 minus 10, to give 1985. However, if you leave the quotations out of the specific string to be replaced, this would result in "2000-05-10", which Alteryx then reads as a date.

 

DataNath_0-1655015380293.png

lindsayhupp
8 - Asteroid

It worked! Thank you, thank you, thank you!

Labels