Alteryx Designer Desktop Discussions

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

Make Input field optional

hemant86
11 - Bolide

Hi Team,

 

I'm trying to take inputs from user basis on which I provide an extract. Issue here is that here all the fields are mandatory but I want to make the input fields optional. Appreciate any help. Please find the sample workflow in the attachment.

 

5 REPLIES 5
Qiu
20 - Arcturus
20 - Arcturus

@hemant86 
The input Excel is missing, so can not really check the flow. but I noticed below. maybe you can give a try.

Capture1A.PNGCapture1B.PNG

hemant86
11 - Bolide

Thanks @Qiu I have attached an updated workflow and the input file. And are you saying removing the double quote will make the fields optional?

Qiu
20 - Arcturus
20 - Arcturus

@hemant86 
For now, it is working, I think.

 

hemant86
11 - Bolide

Hi @Qiu . Its working because I have kept a default value of "00" in Lot no. Please remove the default value and it will ask for "Please enter a value"

danilang
19 - Altair
19 - Altair

Hi @hemant86 

 

The error is thrown by the Filter tool, so you need to change Action(5) so the condition is always correct.  If the value in the input tool is blank, the formula in the Filter becomes [Lot No]= so there is nothing to compare [Lot no] to.  To fix this you need to change the workflow so the formula in the Filter tool is always correct.    In the attached example, I assume that if the user leaves [Lot No] blank, they want to see all the lots. 

 

danilang_2-1648382663071.png

 

Action tools always treat their targets as string, so to make the logic in the filter tool work properly, you need two Action tools, both set to Update Value with Formula. The first one changes operand in the filter tool, which is "2".  If the input is not blank, the number is put in the place of the original "2".  If the input is blank, the "2" is replaced with "-1". 

 

The second Action tool changes the operator in the filter.  If the input is not blank, the operator is left as "=".  If the input is blank, the operator is changed to "!="(not equals).  The end result of these two Action tools working together is that the formula in the Filter is either "[Lot No] = X" where X is the value in the Text Box or "[Lot No] != -1"  if the Text Box is empty.  

 

Note:  In the formulas in the action tools, the [#1] represents the text value coming in from the connected Interface tool. 

 

Dan

  

Labels