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 / Setting a record varia...
Power Apps
Answered

Setting a record variable with SQL Server data

(0) ShareShare
ReportReport
Posted on by

We are creating an application that uses an on-prem SQL Server db.

 

I'm running into an odd situation where when a view is queried, it will return data but will not populate all of the columns in the global variable record.

 

For instance, if my SQL view is returning a row that contains:

  • lastname
  • firstname
  • id number
  • grade
  • whatever
  • whoever

When it populates the variable, it will only populate a column that is used in the lookup.  In the case below, it would populate the personID column but nothing else.  If I have a text label on a screen, it would populate the column that I use in the label.
Set(wtf,LookUp(
vw_CaseNumber,
personID = 10031));

 

If I just do a lookup, it's fine:

hanzelmans_1-1683220584955.png

I have no idea what's going on, but it's frustrating.  I want to build a global variable and not have to do a lookup for the same data.  It doesn't matter if I use a record, collection, etc.  Still the same problem.

 

Any clues?

Categories:
I have the same question (0)
  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @hanzelmans ,

    AhmedSalih_0-1683221517758.png

     

    If my reply helped you, please give a 👍  , & if it solved your issue, please give a 👍  & Accept it as the Solution to help other community members find it more.

    I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.

    Visit my Blog: www.powerplatformplace.com

    Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos

     

     

  • hanzelmans Profile Picture
    on at

    Thanks a ton Ahmed!

    Is there anything else that I should be watching out for when using on-prem SQL Server?

    Steve

  • AhmedSalih Profile Picture
    6,680 Moderator on at

    @hanzelmans, nothing else you should be worried about in regards to on-prem SQL. If you faced any other issue, I am always happy to help. 🙂

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard