Show_if constraints suddenly stopped working as they should

I have had managed to get the show_ifs working as they should, so far, until recently when they have stopped working.

The column had show_if constraints based on user roles, which was retrieved using an expression any(Profile Slice[Role]), where the Profile Slice is a slice that filters out all but the current user, and the [Role] column is the role associated with a user.

The show if was defined as:
or(any(Profile Slice[Role])=โ€œAdminโ€, any(Profile Slice[Role])=โ€œModeratorโ€)

One thing that I surmise might be causing the problem is that the view in which the problem is showing up is from a slice from the main table. Is that so that show_ifs donโ€™t apply to slices?

Solved Solved
0 5 302
1 ACCEPTED SOLUTION

That should work ok. Are you saying that on a different UX view this works ok? Is there a pattern of where it works and where it does not, given the exact same expression above?

BTW, your expression could also read:

in(any(Profile Slice[Role]), {โ€œAdminโ€,โ€œModeratorโ€} )

View solution in original post

5 REPLIES 5

That should work ok. Are you saying that on a different UX view this works ok? Is there a pattern of where it works and where it does not, given the exact same expression above?

BTW, your expression could also read:

in(any(Profile Slice[Role]), {โ€œAdminโ€,โ€œModeratorโ€} )

Thanks for this. โค๏ธ

I disabled the "apply show_if constraints universallyโ€™ option in forms.

Enabling it resolved the problem.

But I do want to hide some columns in form views, or other. Last time I checked, the Context thing didnโ€™t work.

It should work just fine. What expression(s) did you try?

Another option for hiding columns in form views is to base the form on a slice which excludes the undesirable columns.

My bad, I mixed up view types and stuff. Long story.

Itโ€™s working now, no worries.

Top Labels in this Space