Compare Lookup Choice and Compare People

  • 12 April 2018
  • 2 replies
  • 5 views

Badge +1

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|domainuser" and "UserID;#Name".

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


2 replies

Badge +16

Have you looked at the blog post ‌ which shows you how to get the different values from a lookup field in Nintex Forms?

Badge +1

Thank you very much!

Finally got it working.

Problem #1 solved thanks to Cassy Freeman‌.

Problem #2 solved by following this thread: https://community.nintex.com/thread/10638

Final result to check if current user is authorized to perform requests for a selected Location:

!inArray(parselookup(lookup("List A", "Location", parselookup(Location),"Authorized staff")), userProfileLookup({Common:CurrentUser},"PreferredName") )

Reply