Is there a way to assign multiple variable to one component?

I’m creating a contact web app (for NDA purposes I’m not using exacts, just getting close). There are several types of contacts the user can create, location, person, and item are examples. The user will have the option to search for contacts and apply advanced filters. For example, the user will be able to filter contact type, search for keywords, and use advanced filters for things like “First name - Contains - sam” (like mail rules)

I would like to make the prototype as flexible as possible. So if the user searches for “Macy” it should return all contact types with that value. If the user wants to only see locations that have “Macy” they would select the Location option as the contact type. Then if they wanted to apply more filters they could add a rule that says “City - Contains - York” Then would see all Locations with Macy in the result that also have York in the city field.

I would love to be able to assign multiple variables to an element. Then as a tester uses the prototype to apply predefined filters, it hides elements that don’t have true values for each variable. For example: locations that contain a match for “Macy” but “City - Does not contain - York” are not shown. If I could apply multiple variables or user component properties or something like them to make contact cards visible or not that would be great.

It could be used widely with any type of “multiple conditions must be met to…” scenario.

Does anyone know if something like this is possible now?

I put together a dual filtering example a while back that may be helpful.

View the Prototype
Get the File

For the prototype, you could fake the searching option and just auto-fill that with “Macy” if they click the search field and then filter by that.

Hey Nate,
Do you think it would be possible to select multiple entries from the dropdown like History AND Politics, if an article gets one or the other or both they would appear?

In my example when one clicks on a topic from the dropdown, I set the selected topic variable to what was clicked, like “History”, and then run through some “if” conditionals to check what was selected and then show the corresponding articles.

For a multi-select/checkbox version, I’d use a different approach. One idea is any time someone checks a topic you would set the corresponding topic article(s) visibility/boolean variable == true — or if you uncheck the topic, you’d set it to false to hide the article(s).

Very helpful! Thank you!

And yes, most of the searches I provide in prototypes are auto-filled. It’s a great way to exert a little bit of control. lol

1 Like