Alteryx Designer Desktop Discussions

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

Updating Filter Field Using App

simon_carleton1
6 - Meteoroid

Hi all,

 

I am looking to create an app interface where the user can update both the field in the filter and the value of that field. This will mean I don't have to create multiple filters to allow the user to filter by whichever field they are needing. 

 

So the user might need to filter by field A, and choose a value of 10 to filter. Or maybe they need to filter by field B, and the value they input into the filter is "London". 

 

I am able to use a text box and action tool to update the value in the filter (right hand side of the screenshot below). 

 

But I'm trying unsuccessfully to set up the interface tools to allow the user to choose the field for the filter. 

 

I have a select tool which connects to a list box interface tool to create a drop down list of the fields the user may choose to filter by. 

 

I would like then the field that the user chooses, to be selected as the field in the filter. I try to update value but the filter receives a list of fields and true / false next to them, rather than simply updating the field name to the selected field name. 

 

Any advice would be gratefully received.

 

 

Screenshot 2024-02-28 114255.jpg

12 REPLIES 12
Raj
14 - Magnetar

To achieve this in Alteryx, you can use the Interface tools to allow the user to select both the field and the value for filtering

  1. Use a Select tool to create a list of fields that the user can choose from.
  2. Connect the Select tool to a List Box Interface tool. This will create a drop-down list of fields for the user.
  3. Use another Interface tool (e.g., Text Box) to allow the user to input the desired value for filtering.
  4. Connect these Interface tools to a Formula tool.

apathetichell
18 - Pollux

Are your values always of type string or all of type number (and are you using dates)? if not - this is a pain. it's doable - but I'd recommend something like recordid/split datastream using two dynamic selects -one for strings/one for numbers (and a third for dates if you need it)- follow the outline from @Raj - joan back (remember your recordid - and remember to include it in your tests for non-numeric fields in your dynamic select) after you change the value in the formula tool. note - you'll have to convert your text input into a number for your numeric fields either in the formula (where you assume text is being sent in) or in the action tool.

simon_carleton1
6 - Meteoroid

thanks for the reply Raj - I now have the first 3 steps working fine. 

 

Regarding step 4 - how will I use the formula tool to populate the filter field? I currently have the connected list box running through an action tool, but when I link it to the filter I don't get the desired result it brings through false / true for each potential filter.

 

workflow6.JPG

 

 

workflow7.JPG

simon_carleton1
6 - Meteoroid

thanks for your reply Apathetichell - all my filter fields are V_String, so hopefully that makes this process a bit easier. 

 

I'm struggling though with what role the formula field will play - please see my previous reply to Raj. 

Raj
14 - Magnetar

@simon_carleton1 will you be able to share your workflow with sample data will modify it.

 

else once i get bag to device will try to help with the formula.

apathetichell
18 - Pollux

your value must change in your formula tool (you will need to connect the action tools to it). I would (strongly) recommned flowing like this -> following your filter which is set up like

[test]=value (with your field set up to update test and your value set up to update value) - dynamic rename (select all/formula mode - formula of 

if [_CurrentField_]="test" then "changed" else [_CurrentField_] endif 

next formula tool - using field changed

value here would be "value" - with an action tool set up to update that.

then dynamic rename (again!)

with 

if [_CurrentField_]="changed" then "test" else [_CurrentField_] endif

 

with an action tool set up to edit test.

 

basically you need dummy values which are concrete values in your filter tool and both dynamic selects. I'd recommend setting these for base fields in your workflow so you can test this. Your action tool must change those values. 

 

You cannot do two things at once easily. 

 

Your change logic should pass a full value - or use a staging field - or use formula logic in your action tool.  

simon_carleton1
6 - Meteoroid

Hi Raj and Apathetichell,

 

I've attached a sample workflow. To confirm, currently I'm able to update the value in the filter but not the field. 

 

Apathetichell, unfortunately I'm not able to follow your most recent instructions - I'm very new to this so it's just over my head I'm afraid.

 

Maybe if either / both of you wouldn't mind updating my sample workflow, and then I can follow the working example as a means of building my understanding. I'd be hugely grateful.

 

thanks again

apathetichell
18 - Pollux

upload your input if this doesn't work - but this should do what you want.

apathetichell
18 - Pollux

actually - re read what you wanted. try this one.

Labels