Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • AhmedSalih Profile Picture
    6,678 Super User 2025 Season 1 on at
    Re: Setting a record variable with SQL Server data

    @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. 🙂

  • hanzelmans Profile Picture
    on at
    Re: Setting a record variable with SQL Server data

    Thanks a ton Ahmed!

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

    Steve

  • Verified answer
    AhmedSalih Profile Picture
    6,678 Super User 2025 Season 1 on at
    Re: Setting a record variable with SQL Server data

    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

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz โ€“ Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Communityโ€ฆ

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard