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

Having difficulty with using text input and action tool to dynamically update filter

adriennelenker
7 - Meteor

Hi all,

 

I'm starting out with Alteryx. I'm trying to connect a user input text tool to an action tool to filter records based on what the user input. I'm unsure how to configure the action tool and filter tool. Also, in general, I do not know how to edit the action tool. I've downloaded sample workflows with configured action tools, and when I connect that action tool to my workflow the configuration disappears and I cannot write a custom configuation.

 

My workflow is attached, my desired output is:

 

UT IDcitystate

109823

raleighnc
109823baltimoremd
109823dallastx

 

Thank you for any help. 

6 REPLIES 6
DataNath
17 - Castor
17 - Castor

Hey @adriennelenker, here's a little breakdown of the current state of your App and how we can get it working. At present, you're not actually filtering anything. You're just stating a field without any accompanying evaluation:

 

DataNath_0-1676562497014.png

 

Filters need to be boolean checks i.e. does my data satisfy (true/false) this statement of not. In your case this could be something like [UT ID] = 109823 - Alteryx will filter records where the [UT ID] is 109823 out of the top (True) anchor, and everything else will flow out of the bottom (False) anchor.

 

Regarding the action tool, you haven't selected anything to be changed by user input. For filters, we have 2 options - the mode (basic or custom), as well as the expression that sits inside the custom filter when ticked:

 

DataNath_1-1676562586658.png

 

Therefore, to get your App into a working state, we need to fix both of the steps above...

 

1) We put an actual evaluation in the filter i.e. is this true or false? When setting an app up, you can use anything for this, it's just a placeholder as the value being checked will be replaced by the user input every time it's ran. So I'll just use 1234 - you'll notice that when I run this normally in the canvas, everything is false so no results come through True, but as mentioned above, the 1234 will be replaced by the user input when running this as an actual app so it's alright:

 

DataNath_2-1676562727664.png

 

2) Now the second part is ensuring that our Text Box input actually updates the expression inside the Filter tool. To do this, we highlight that we want to update the Expression (seen below). You'll also want to tick 'Replace a specific string' and ensure it's only the 1234 part being swapped out. Otherwise, your entire expression i.e. [UT ID] = 1234 will just be changed to 1234 and ruin your filter:

 

DataNath_3-1676562858621.png

 

One helpful tip when building apps is to run the app in debug mode - this allows you to enter values/configure the app as if you were running it for real, and it'll then open up a workflow with the swapped out values etc. that show what the workflow would look like behind the scenes of your app result. If you go to the Interface Designer (Ctrl+Alt+D) and hit the magic wand (Test View), you can enter a value and the 'Open Debug' to see this. If I type in an actual [UT ID] and try it out, you'll see we now get the expected results:

 

DataNath_4-1676563018703.pngDataNath_5-1676563029352.png

 

And if I just run it as a regular app:

 

DataNath_6-1676563052418.png

 

Really hope this was useful - I've attached the fixed app for you to look over as well! Please shout if you have further questions.

adriennelenker
7 - Meteor

Hi @DataNath  This was very helpful, thanks!

 

My next question is, I'm trying to applying this structure to a formula and it's not working. I've attached a workflow, is there something wrong with how I'm doing it? Thanks

(It's a zip file)

DataNath
17 - Castor
17 - Castor

Hey @adriennelenker, you'll need to again expand out the options in the Action configuration until you can see the @expression part, then you can once again reduce this down to the dummy value (1234) you have, as the target to replace:

 

DataNath_0-1676570315807.png

 

Another quick note is that you have nothing after the Formula. In order to see the results of an app you need to put something like a Browse tool or Render in order to see the results. Therefore, if you add a Browse and tick to show the results of this on a successful run in the Interface Designer:

 

DataNath_1-1676570383865.png

 

When you run the app it should show what you're expecting:

 

DataNath_3-1676570428173.png

 

Have once again attached the fixed workflow, hope this helps!

adriennelenker
7 - Meteor

Hi @DataNath thank you for all the help, this worked perfectly. I have one more question. My formula tool has multiple parts. One part is checking for the UT ID, the second is checking for the city. I am able to do one-part formula correctly, but with multiple parts it's failing. My workflow is attached in a zip file. I have two text box-action tool combos connected to the same formula tool. The formula tool has two lines. I followed the way you did it, I assigned the city formula dummy as "5678" However, while the ID formula runs, the second city formula does not. 

 

Do you have ideas on how to solve this? Thanks

DataNath
17 - Castor
17 - Castor

@adriennelenker as mentioned previously, you need to expand out the '+' boxes to reveal the @expression option and then select that. For the first one it'll be like this (do the same for the second one):

 

DataNath_0-1676590147611.png

 

Your Action tool currently just looks like this, you're just selecting Formula - need to expand out the menu and make sure it's applying the change to the expression:

 

DataNath_1-1676590207633.png

 

For the one you're using 5678 as a dummy for, you'll need to put this in quotes i.e. [City] = '5678' and again reduce down the target to 5678 only as the replacement will need to go inside the quotes e.g. [City] = 'raleigh'.

adriennelenker
7 - Meteor

Thank you for all the help @DataNath . I sincerely appreciate it.

Labels