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

Alteryx Designer Desktop Discussions

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

Replace a DateTime with String in Action Tool

hlau117
6 - Meteoroid

I have a formula tool that calculates by default the first monday of the week. I also have a text box tool that allows the user to override the formula tool date by inputting their date of their choice. I am using an update value with formula

that says if the text date is empty, then use the default date from the formula tool otherwise, use the input date.

 

However, I am not able to get the updated date reflected by the manual text input. Attached is the workflow

2 REPLIES 2
fmvizcaino
17 - Castor
17 - Castor

Hi @hlau117 ,

 

In your replace function, you need to use quotes in your second parameter and also, since your user is passing a date, you need to guarantee that you will have your date surronded by quotes.

I standardized your formula using double quotes in all formulas to use ' as the second parameter delimiter.

 

IF isEmpty([#1]) THEN '1' ELSE REPLACE([Destination],'DateTimeFormat(DATETIMEADD(DateTimeToday(),- IF TONUMBER(DATETIMEFORMAT(DateTimeToday(),"%w"))=0 THEN 7 ELSE TONUMBER(DATETIMEFORMAT(DateTimeToday(),"%w"))ENDIF +1,"days"),"%m-%d-%Y")', "'"+[#1]+"'") ENDIF

 

Best,

Fernando Vizcaino

hlau117
6 - Meteoroid

@

 

Labels