FilterBy Bool Mask More than one criteria

In my image below I have a list with with 23 different lines of text. I also have a UI using datashapes that shows 5 options to choose from. When the UI comes up I will choose more than one option and click the accept button on the Data Shape UI. If I choose one option the filtering works great and the filterbyboolmask will filter the text properly. However, if I choose more than one option in the UI it wont use both in the boolean mask. How do I get the filterbyboolmask to see more than one option and make those options true within the list instead of just one?

FilterByBoolMask takes one list of items and one list of booleans to filter into true/false groupings.

One option for multiple filters is to use list levels to filter your data multiple times (for each condition) and then flatten those individual results back into a single list. This is super straightforward and easy but does reorder your original list based on the order of the conditions.

Another option is to use an OR conditional to determine if an item meets any of the conditions you have set. This would reduce your multiple conditional results down to a single list of booleans that would align with the single list of items to filter. This is done before the FilterByBoolMask node and retains the original list order.

The Or statement sound the most promising. Because I do want to keep the order. Are you saying place and Or between the form++ and String Contains?

An OR statement works by checking to see if any two (or more) inputs are true. You would want to pass each conditional value (per item) into an OR statement to see if the item passes any of the conditions.

Dynamo actually has a node specifically for multiple conditions called List.AnyTrue that checks to see if any value in a list is true. This would do exactly what you want.

Here is what I went with. The whole purpose was to create 3d views and apply a view template. We use these views in model coordination on ACC. I pull views from a template revit model that holds the 3d views. Load in the view templates. Transfer them to current model. Then based on choices from Data Shapes create the necessary 3d views and apply the appropriate view template

1 Like

Unfortunately your graph is illegible at that scale, but it looks like you have it working with List.AnyTrue.

You can click it and it will increase in size.

Try it and seee what it looks like.

2 Likes