I’m wondering if anyone has thoughts on easily implementing “OR” logic on visibility rules for components. Stacking layers does a fine job of creating “AND” functionality, but what about if you want something to be visible if one of multiple conditions are met?
AND is derived from count relation=count preference
OR is derived from count relation>0
If you want to have OR AND in action conditional, search for Binary Total, it is a proxy variable that we need to update first, so we can use them in single expression conditional.
I had explored that as an option. Not super practical for me, as I have more than 2 possibilities to choose from.
HOWEVER, revisiting the concept gave me a new idea that I hadn’t considered up to this point. I use “hidden” text inputs a lot to control visibility and inputs, and I realized I could use the same idea to accomplish “Or” visibility logic:
I create a text input, call it “ShowButtons”. Set the default value to 0, and make it all transparent and small so the user can’t see it.
I create my conditionally visible button, and set the visibilty to sometimes visible, when “ShowButtons” = 1
Then, I use the the screen onLoad actions to set the “ShowButtons” variable, using the “Change Input Value” Action, which have their own “sometimes” logic.
I create an action to Change Input Value of “ShowButtons” to 1, then set it so it only happens if one of my conditions is met. I can stack as many of these actions as I want - each one set to make the “ShowButtons” input to 1 IF it’s specific condition is met.
Now, when the screen loads, it will run through the conditional actions, and if ANY of them are met, it will set the “ShowButtons” input to 1, and the Button will display!
Best part is it’s dead simple AND doesn’t clutter up my collections. Problem SOLVED.
Thank you. I appreciate your reply as it led to my brainstorming of this solution
can you explain this group solution a little more?
I want to be able to filter based on open, closed, and all.
My documents have a status of open or closed so I can filter for those, but when I want to see everything in the list the filter doesn’t work any longer
thanks for sending this over, but i have absolutely no idea what is going on in this app you sent me so it is of no real use to me without an explanation
If we’re talking about “generic” OR logic for some abstract component, then I’m afraid that there is no straightforward way to do it. The only option is creating a conditionally visible component for each case.
E.g. if you have a button and you’d like to display it when Logged-in User → Color is Blue, Red or Orange, you will need to create 3 buttons for each case.
However in some particular cases you can optimise this. E.g. for the lists there is already an OR filter (so you can have less lists on a screen).
Also you may try to find another property in common for all cases with the same OR condition. E.g. if you’d like to display the button when Logged-in User → Color is Black, Grey or White, you can have an additional property “colortype”, for Black, Grey or White it will contain “achromatic”, and then you use this property.
Using “contains” instead of “is equal to” also may be useful in some cases.
In other cases you can try to use numeric properties as a filter base: e.g. if you have a workflow with 5 stages, and you’d like to show some button only for stages 2 and 3, you can use “Stage ID” is between 1.9 and 3.1.
These all are workarounds though, as a fundamental functionality is missing.