Updating Filter Field Using App
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Labels:
- Apps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Use a Select tool to create a list of fields that the user can choose from.
- Connect the Select tool to a List Box Interface tool. This will create a drop-down list of fields for the user.
- Use another Interface tool (e.g., Text Box) to allow the user to input the desired value for filtering.
- Connect these Interface tools to a Formula tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
