Intersection of two lists from the same option set?

I want to display the values of two list-fields from a database. It seemed easy enough but I’m struggling since days with that.

Here the goal is visualized:

What I have:

Data

  • Tables: user, supplements (both have a list-field for the option set benefits)
  • Option set: benefits

Design & workflows:

  • Check boxes are supposed to display the options so the user can select multiple of the options
  • As output I want a (visual) table, that shows for each supplement the intersection between user and supplements benefits options

My issues:
1. How do I save the data from the checkboxes into the list-field?
It seems not to work with list items as it does with normal text fields.
image

2. How do I get to show the intersection of the options from both tables?
Table:
image

Repeating group within the cell of the table:
image

The text field with the repeating group:
image

It stays empty. Tried multiple methods and approaches including but all failed in one way or the other. Would appreciate help a lot! :slight_smile:

Hey man,

I think there are a few solutions to your problem, but it seems more like a conceptual thing that needs some forward thinking.

I coulde be up for a 20-minute Zoom tomorrow to talk it over?
I need to get out of my own head for a bit and could use a break from talking to my plants …

if so, just hit me up.

Hey @richard.neb1 ,

You can try with this expression.

We are searching for Supplements using advanced filter and seeking for a valid intersection of benefits between the user and supplement.

In the screenshot the expression is used in a Text block but you should be able to put that in a RG’s datasource with type “Supplements” relevant for the User as per the selected benefits.

Let me know if this works for you.
Happy to help further if needed.

Thanks @sxtn.digital again for the call!

@codefree thanks for the input! I see a list of all, not just the intersection.

This is what I’ve got:
Table:
image

Repeating group within the cell:
image

Text element within the repeating group:
image

1 Like

@richard.neb1 Do you want to get on a quick call?

The expression should work. I would request you to check the actual benefits data. (As per the expression) Even if one of the supplement’s benefit intersects with the current user’s benefit, it should be visible in the list.

I hope the call was helpful. Wish you the best @richard.neb1

Feel free to reaching directly in future. You can schedule a call a meeting here (https://meeting.codefree.io)

Thanks again for the quick help!

In case someone has the same issues, here is the solution:

  1. To save the answers from the checkboxes into the database custom states must be used.
  2. For showing only the intersection here is the expression:

image

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