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 / Set multiple variables...
Power Apps
Answered

Set multiple variables with one LookUp

(0) ShareShare
ReportReport
Posted on by 71

In my Canvas Power App I've been running a vehicle search against a SQL Server data source, but I'd like to reduce my query costs at the server level.  Currently my on select has the following code:


Set(XVIN,LookUp(Trucks,Plate = XPlate && PlateState = XPlateState,VIN));
Set(XManufacturer,LookUp(Trucks,Plate = XPlate && PlateState = XPlateState,Manufacturer));
Set(XModel,LookUp(Trucks,Plate = XPlate && PlateState = XPlateState,Model));
Set(XModelYear,LookUp(Trucks,Plate = XPlate && PlateState = XPlateState,ModelYear));
Set(XEngineType,LookUp(Trucks,Plate = XPlate && PlateState = XPlateState,EngineType));
Set(XVehicleClass,LookUp(Trucks,Plate = XPlate && PlateState = XPlateState,GVWR));

Is there a way to consolidate these six queries into one and get the same effect?

Categories:
  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @RobDin , Try This:

     

    Set(gblvar,LookUp(Trucks,Plate = XPlate && PlateState = XPlateState))

     

     

    Now you can use this gblvar using "dot" Example:

    gblvar.VIN

    gblvar.Manufacturer

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard