community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

OPTION TO LEAVE TEXT BOX BLANK IN ANALYTIC APP

Alteryx Partner

This is an app I made that filters a set of job announcements. 

 

How do I leave the text box blank in an analytic app so that it still returns the correct values? In other words, if I leave the text box blank, I want it to act as if that particular filter isn't being applied.

 

For example, if I put "python" in the first box, and nothing in the second, it should return 3 records. 

 

 

Magnetar
Magnetar

Hi,

 

Your workflow was very close.  I updated your two Action Tools that were connected to Text Input tools to use the option "Update Value with Formula".

 

The template I used for this formula was as follows:

IF ISEMPTY([#1]) THEN '1=1' ELSE REPLACE([Destination],'KEYWORD',[#1]) ENDIF

[#1] Is the input from your text box, and [Destination] is the tool that Action is updating.

 

So this says - if the text box is empty, replace the filter with 1=1, which is always true.  Otherwise, replace the keyword (ALTERYX or WASHINGTON in your example) with the result of the text input.

 

Hope this helps!

Alteryx Certified Partner
Alteryx Certified Partner

Update Action(62) to "Update Value with Formula" and use this formula:

 

IF isempty([#1]) THEN '1'
ELSE 'contains([Description],"'+[#1]+'")'
ENDIF

 

So if the text input is empty, all records will pass. Otherwise the contains function will be applied.

Highlighted
Alteryx Partner

Thanks to you both.  Both solutions worked. Is there a methodology for who I should choose as best answer?  Is it just the first correct?

Alteryx Certified Partner
Alteryx Certified Partner

I'm glad you got the help you were looking for. If multiple solutions of like quality are offered, then the first posted is typically awarded the solution. I think multiple solutions could also be awarded. I would make sure @Claje gets a solution for this.

Magnetar
Magnetar

You can actually mark multiple posts as a solution, so if you found each of our posts helpful, feel free to mark them both as a solution!

Labels