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

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,678 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,678 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

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