OR Expression & Enumlist

I have a public app I am trying to let some individuals make updates to specific rows based on matching either criteria in an OR statement. I'm having difficulty getting a row level expression that doesn't let any row in the focus table, nursing home profile, to be edited. 

  • I have a table "nursing home profile" with a column Access Codes (text)
  • I have a table "editors" with a column editorID an Access Codes Column (enumlist)
  • I have usersettings with an EditorID (ref) column and an Access Codes Column (enumlist)

I want to put a condition statement in place that evaluates for true or false.

The first condition I want to check is for the editorid in the usersettings, for the related record in the editors table - do any of the values in the access codes list from the editors table match the access codes value in the nursing home table.

If not I want to see if any of the access codes entered in the user settings list match.

I've tried splitting and comparing, even with the ref or [_THISROW_ and either get access to edit the entire nursing home table or can't get to edit anything...

How can i format the expression for this?

 

 

0 2 62
2 REPLIES 2

If I understand you requirements correctly, assuming you are trying to set a security filter on nursing home profile, try

IN(
 [Access Codes],
 UNIQUE( 
  SELECT(
   editors[Access Codes],
   [editorID] = USERSETTINGS("EditorID")
  )
  +
  USERSETTINGS("Access Codes")
 )
)

Sort of. I already have a security filter applied to the editors table to pull just the row where primaryemail in usersettings matches the affliated row in the editors table.

This works, allowing the edit icon for access codes added under usersettings but it does not work for codes in the list from the access codes column in the editors table. 

A work around I put in place is to set the initial value of the access codes in usersettings to be the value of that column in the editors table for the affiliated entry. Would still like to get a solution or understanding to this expression though ๐Ÿ™‚

Top Labels in this Space