Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
shinnickr
Creator II
Creator II

Conditional hide/show columns with multiple selections.

Hi there,

I have a bit of a weird problem.  I have been tasked with showing/hiding columns based on a current selection.  I am able to do that with a condition like:

if(isnull(GetFieldSelections([Rule Description])), 1, 0)

OR

if(Index([Rule Description], 1, 1), 1, 0)

OR

if(Index([Rule Description], 2, 1), 1, 0)

OR

if(Index([Rule Description], 4, 1), 1, 0)

OR

if(Index([Rule Description], 5, 1), 1, 0)

OR

if(Index([Rule Description], 14, 1), 1, 0)

So, if there is no selection, show all the fields.  If the [Rule Description] field has a 1, show the column else hide it, etc.

The problem I've run into, is that if someone selects multiple [Rule Description]s it doesn't show any of the columns with this formula in it.  What are my options for getting around this?  Any ideas?

Thanks!

14 Replies
Mark_Little
Luminary
Luminary

Hi Ryan,

I am struggling to understand exactly how you are trying to do this.

So is it something like IF A and C is selected in field1, then show columns 1,4,6

IF A is Selected in field1, Show 1,2

Mark

shinnickr
Creator II
Creator II
Author

Yes exactly.

Mark_Little
Luminary
Luminary

Morning Ryan,

I would be looking at something like

if(isnull(GetFieldSelections([Rule Description])) OR GetFieldSelections([Rule Description]) = 'A,B',

     1,

     0)

So you are just saying when nothing is selected or the certain selections (A and B in the above example - replace with your needed selections) show me this column.

If you are not sure what you need to replace A and B with, create a text box and add the function

=GetFieldSelections([Rule Description])

Make your selections and it will show you what is needed.

Mark

shinnickr
Creator II
Creator II
Author

Good morning Mark,

I appreciate the help on this!

I like your idea, it's simple and makes sense.  The only problem is that I have 14 different Rule Descriptions, and people will be dynamically picking and choosing which ones they want.  So I'd have to hard code every single description in there with all the different possible combinations.

Someone above suggested using wildmatch() with getfieldselections() and I've gotten it to work with that!

Thanks again for the help and talking it through with me.  It's helped me understand it all a bit more.

shinnickr
Creator II
Creator II
Author

After some trial and error I managed to get this to work.

I have 14 different [Rule Description]s, all numbered 1), 2), 3), etc.  So using the formula below I am able to do - if no [Rule Description] is selected, show the column.  And then when the selection has a '3) ' in it, show the selection.  By doing the wildmatch I was able to show the required columns with multiple selections.

if(isnull(GetFieldSelections([Rule Description])), 1, 0)

OR

if(wildmatch(getfieldselections([Rule Description]),'*3) *'), 1, 0)

OR

if(wildmatch(getfieldselections([Rule Description]),'*8) *'), 1, 0)

OR

if(wildmatch(getfieldselections([Rule Description]),'*9) *'), 1, 0)

OR

if(wildmatch(getfieldselections([Rule Description]),'*10) *'), 1, 0)

OR

if(wildmatch(getfieldselections([Rule Description]),'*11) *'), 1, 0)

OR

if(wildmatch(getfieldselections([Rule Description]),'*12) *'), 1, 0)

I hope this makes sense for anyone who might possibly have the same problem that I did!