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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to find a record b...
Power Apps
Unanswered

How to find a record based on a number or string value

(0) ShareShare
ReportReport
Posted on by 25

What's wring with this "code":

 

 

UpdateContext(
 {
 Code: RandBetween(
 1;
 3
 )
 }
);;
UpdateContext(
 {
 SavedName: LookUp(
 Items;
 ThisRecord.Code = Code;
 Name
 )
 }
);;

 

 

I have an excel table with three items in it named: "Items". I want to search for the "Code" column and than save the "Name" property of this record in a second var. Why is the above not working? Because the "SavedName" variable is always the first name of the table.

Categories:
I have the same question (0)
  • Verified answer
    Akser Profile Picture
    1,546 Moderator on at

    Hi @kiro7shiro,

     

    My guess is that PowerApps gets confused when you use the same names. Can you try the following?

     

     

    UpdateContext(
     {
     RandomCode: RandBetween(
     1;
     3
     )
     }
    );;
    UpdateContext(
     {
     SavedName: LookUp(
     Items;
     Items[@Code] = RandomCode; //Code = RandomCode should also work I guess
     Name
     )
     }
    );;
    

     

     

  • kiro7shiro Profile Picture
    25 on at

    My guess is powerapps confuses a lot of things. Especially since those two variables should not interfer with another. Because they are declared in an entire seperate context. One on the table and the other in the app context. Very wierd. Again! 😉

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard