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

Dynamically input todays date using the update value tool

cat_modeller
6 - Meteoroid

Hi all,

 

Is there a way to update a render output file name and string within an email subject / body with todays date automatically? Currently I use the date tool within the interface tab (see below), however this requires user input: in an ideal world this date can be included automatically so I can schedule the workflow to run every week.

 

Thanks in advance!

 

Alteryx help.PNG

7 REPLIES 7
Treyson
13 - Pulsar
13 - Pulsar

You will want to create a column that creates the name of the file. Something like 'Filename' + tostring(DateTimeToday()). Then on the output tool where you are creating the file, you can have it pull a name from a field.

 

 filenam.png

Treyson Marks
Senior Analytics Engineer
Claje
14 - Magnetar

Hi,

You can actually use fields to create the workflow body or email subject, which I think is a more effective method of doing what you are trying to accomplish.


That way you could use a formula, including the "DateTimeToday()" function to create your subject and body.

 

I can throw together an example if this doesn't give you enough to get started!

CharlieS
17 - Castor
17 - Castor

@cat_modeller

 

Yes, and using the Interface tools are not necessary. Use a Formula tool to update the fields in the datastream that you're composing with the DateTimeNow() function. Edit your string fields before the contents are formatted in the Reporting tools and used in the Email tool. Here's an example:

 

Subject field before: "Alteryx Community Update"

Formula: [Subject]+" - "+tostring(datetimeformat(datetimenow(),"%B %d %Y"))

Subject field after: "Alteryx Community Update - June 26 2018"

 

Let me know if you have any questions.

cat_modeller
6 - Meteoroid

Hi Treyson,

 

Thanks for getting back so quickly - is there any chance I can do this using the render tool instead of the output tool? Ideally the outputted table is a rendered spreadsheet, it would be great if the file could contain some formatting. 

cat_modeller
6 - Meteoroid

Hi Claje,

 

Thanks for getting back so quickly - with regards to your method, is that able to include a table within the body / formatting within the text?

 

I've had a go using using your method but using reporting text tool to format but have not had much luck. If you are able to provide an example that would be hugely appreciated!

 

 

Claje
14 - Magnetar

Sure thing!

I've attached an example that uses a table in the Body, and uses the report text tool to accomplish this.  I wrote the text in a formula, because I think that is easier to handle, but depending on your needs, you may be able to write inside Report Text.  If you want to only use Report Text, I recommend adding a column for DateTimeToday for ease of use in the Report Text tool.  Then you can do any kind of formatting you want.

 

The key here is making sure the Report Text is added as part of the Table output.

 

Hope this helps!

cat_modeller
6 - Meteoroid

Thank you so much! Yes - applying the formula to the body text beforehand and then using the append tool to add the table were two steps that did not realize were possible. 

Labels