web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to specify scope i...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 433

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?

 

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @akharns 

     

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

  • akharns Profile Picture
    433 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard