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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard