AnsweredAssumed Answered

Compare Lookup Choice and Compare People

Question asked by tim92_2 on Apr 12, 2018
Latest reply on Apr 12, 2018 by tim92_2

Hi there,

 

I'm currently facing two issues:

 

#1 Comparing a lookup choice list entry with a list entry of another list

I've got two lists A and B.

List A contains following columns

  • "Location", which is a single line of text (unique values).
  • "Authorized staff", which is a Person or Group column, allow multiple selections, People only, Show field: Name

 

List B contains following columns (this is my Access request form)

  • "Location", which is a lookup column to list A (column "Location")

 

In the form for List B, I want to get the Array of "Authorized staff" from List A based on my choice of "Location" in List B.

I tried the lookup() function, that din't work.

lookup("List A", "Location", Location (from Named Items), "Authorized staff", true)

 

Figuring out what values I get for my "Location" field, i created a "Calculated value" column. That Displays me, based on my choice, following value: "1;#Location 1", where "Location 1" is the actual value.

Any Chance to get the value from the choice field different or do I need to use the substring function?

 

#2 I want to compare the currenUser with the allowed users from List A in Column "Authorized staff"

I though using the inArray() function would suit to my Needs.

Ignoring my problem from #1 I used following lookup to get the array of users for a respective Location:

lookup("List A", "Location", "Location 1", "Authorized staff", true) and I get an Array of users.

Nevertheless, comparing the currentUser vs. the values I get from the field "authorized staff" are different.

e.g. "i:0#.x|domain\user" and "UserID;#Name".

 

 

Somebody with advices for my Problems #1 and #2?

Outcomes