Add/edit/delete conditions to a list collection

Hello, I am building a patient care app for caregivers. I have a collection of caregivers assigned to a given patient for which I would like to limit who can add, edit, and delete the collection.

I would like to add conditional logic where only users that are primary caregivers for the selected patient have the ability to add/edit/delete other caregivers:

  • carerecipientid = screen > rowid AND
  • caregiverid = userprofile > rowid AND
  • primary is true

While I think I have successfully entered this logic for the “allow user to edit this collection”, I am unable to replicate this logic to the “allow user to add to this collection”:

When adding condition to the “allow user to add to this collection”, I can ONLY select from the user or screen fields and cannot select fields from the original data table that is the source of the collection:

What am I doing wrong?

I think you’re not testing the correct row IDs, can you detail more which row ID is used for each condition ?
And what are the data sources for your screen and for your collection ?

It’s hard to guess if it’s from the user profile, the screen or the item as we see only “row ID” everywhere on the screenshot.

Be careful not to mislead the row ID from :

  • User profile > row ID = the user currently connected
  • Current Screen > row ID = depending on the data associated to the current screen, it can be users or any other data source, check if you have filters applied, if your screen data source is the user table it may be the first user or the wrong user
  • Row ID = depending of the data source of the list or collection you are displaying, it is the row ID of the item in the list or collection, it can be different from the row ID of the Current Screen and User Profile
  • IDs from other tables stored in specific columns (like careRecipientID and careGiverID): check if you are collecting the correct IDs, check that you compare the correct ID column to the correct row ID
1 Like

Guillaume made a good point,I don’t know why there needs to be 3 conditions here. If you’re storing the Caregiver’s rowID in each patient row, assuming caregivers are also stored in the Users table, then the condition can be simplified to:

CaregiverID equals to signed-in user’s rowID.

Unless I’m missing something about the “Primary” part and how you’re structuring your data.