Repeating Group with complex constraints

Hi all, I have the following thing type:

Idea

  • Title: text
  • Description: text
  • Author: User
  • private: Yes/No

I have a RG to list the ideas, but it must follow this logic:

(A) Author = Current User AND private = Yes >>> Show the idea
(B) Author = Current User AND private = No >>> Show the idea
© Author <> Current User AND private = Yes >>> DON’T Show the idea
(D) Author <> Current User AND private = No >>> Show the idea

Can’t figure out how to implement these constraints using the Data Source. Could you guys help me?

Tks,
Daniel

Hi Daniel, this expression should do it:

Search for ideas (author = current user, private = yes) merged with Search for ideas (private = no)

The first will get you all of the current user’s private ideas and will be combined with the second, which gets you all non-private ideas regardless of author (which could include the current user).

An alternate route is to remove the private constraint from the first search and add “:unique elements” at the end of the search so that you don’t see any overlapping ideas, but I think the first way is a cleaner search that keeps everything server side.

Hope this helps!


Gaby | Coaching Bubble
Private coaching, courses, and tons of free resources

Hi Gaby,

It works like a charm! Thank you very much!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.