cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akharns
Level 8

How to specify scope in LookUp function, retrieving a description from a remote table

I have set up my test app as follows:

1. My primary table is "testStatusCodes", a OneDrive Excel table containing only one column, 'Status Code'. 

2. My lookup table is "ProcessSteps", a OneDrive Excel table with two relevant columns:  'Status Code' and 'Next Step'

3. My gallery uses testStatusCodes as its data source, displaying all my status codes.

4. My gallery has two fields: v.StatusCode linked to my primary data source (to separate the data elements, so I can see how to use them in my application), and 'v.NextAction', the value I want to retrieve with LookUp.

 

I am trying to get the LookUp function to work.  I see that I do not need to qualify the scope for the field in the primary table.  Here is the logic I'm currently using in 'v.NextAction'.Text:

  • LookUp(ProcessSteps,v.StatusCode=ProcessSteps.'Status Code','Next Step')

Error help says "Invalid argument type" for v.NextAction.Text.   What am I missing?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: How to specify scope in LookUp function, retrieving a description from a remote table

Hi @akharns 

 

LookUp(ProcessSteps,'Status Code'= ThisItem.'Status Code','Next Step')

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: How to specify scope in LookUp function, retrieving a description from a remote table

Hi @akharns 

 

LookUp(ProcessSteps,'Status Code'= ThisItem.'Status Code','Next Step')

View solution in original post

akharns
Level 8

Re: How to specify scope in LookUp function, retrieving a description from a remote table

The key is to know where to specify the scope.  Fully specified, it would be: "LookUp(ProcessSteps,ProcessSteps.'Status Code'= ThisItem.'Status Code','Next Step')", but this is incorrect.

 

Your solution works.  My conclusions:

 

1. It does not matter which item I put on the two sides of the "=" in the condition.

2. I should specify scope in the local table as "ThisItem", and I should reference the table's field name.

3. I should NOT specify the scope for the lookup table's field name.

 

As a further note, when I made this change, it did not retrieve data.  Aparently that was because I had the lookup table open.  After closing it, it worked.

 

Thank you for helping me solve this problem.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,760)