Solved

Lookup function not working when output column is a lookup column

  • 10 November 2020
  • 1 reply
  • 250 views

Badge +5

I have a lookup column in my list. On the form, a user selects an option from a dropdown populated by the values in that lookup column. I would like to take that selected value and use it to lookup another value in that list. But the value I want to retrieve is also from a lookup column.

 

lookup("Value Chain","Subcategory",parseLookup([Form].[Subcategory]),"Adoption Level"))

 

In other words:

lookup(ListName, FilterColumnName, FilterValue which is based on the lookup value selected in the dropdown(parsed), Output column[a lookup column])

 

In this case "Adoption Level" is the lookup column in the second list that is also a lookup value. When I run my form, the dev console spits back this:

 

The query to field 'Adoption_x0020_Level' is not valid. The $select query string must specify the target fields and the $expand query string must contains Adoption_x0020_Level

 

Any ideas on how I can get this to work?

icon

Best answer by ghaiashish 26 November 2020, 13:31

View original

1 reply

Userlevel 2

Hi sgrams


 


Please try using ID field instead of text value to get the value of "Adoption Level"


 


lookup("Value Chain","ID",parseLookup([Form].[Subcategory],false),"Adoption Level"))


 


This needs to be stored in a variable and the variable is passed into the lookup control as a filter


Let me know if you have any further questions


 


Regards.
Ashish


Note: 'parselookup(lookup value, false) returns ID of the look item

Reply