Query to find a value within a list

I have scenario where I have a user record which is linked to a Tenant by a Tenant ID. I want to only display notifications to the Tenant user on a portal where where their tenant ID is part of a multi-select field of recipients of the alert notification. I am struggling with the query of the repeating group on the portal side. I tried using the intersect function but I think that only works if you are comparing two lists. In this case I am comparing a user record field to a multi-value field in another table.

Example:

User Table:
First name: Jane
Last name: Smith
Tenant ID: 1234

Alert notification table: (Recipients is the multi-value field)
Communication title: Welcome notification
Communication body: Test alert notification
Recipients: 9876, 5432, 1234

I would want the repeating group to show only alert notification records where the current user’s tenant ID is in alert notification’s recipients.

Thanks in advance!

Hi there, @brward7… if I understand your post correctly, you should be able to add a constraint to the search for alerts where Recipients contains Current User' Tenant ID. I’m guessing you tried something like that and it doesn’t work?

Best…
Mike

Yes I did try that but no luck.

Any clue from the debugger as to why that isn’t working?

So after looking through the debugger it was a combination of two issues. 1) was I had privacy turned on the field I was trying to query and 2) I did not write the tenant ID properly to the database. So your query that you suggested was the correct query. Thank you!!!

1 Like