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 / Inconsistent Variable ...
Power Apps
Answered

Inconsistent Variable Creation: Some populate, some don't in OnVisible

(0) ShareShare
ReportReport
Posted on by 34

From a dispassionate perspective, I assume I'm doing something wrong because I can't think of any other good explanation. But I can't see that I am doing anything wrong, so maybe someone here can point it out:

 

I have a Power Apps application based on a SharePoint list. I want to populate some variables from values in this SharePoint list using the OnVisible action of the screen on which my form appears, and then plug that variable value into the Default of the card that contains the form field. I also have a separate "pop-up" form in a container on that same screen that allows the user to change these values, which will then update the variables, and thereby update the values in the original form.

 

The problem is that some of the variables will populate with the OnVisible action, and some will not. My first thought was that something must be wrong with the formula I'm using to populate the variables, but if I simply create a label and apply the exact same formula to the Text value of the label, it works fine. That leaves me wondering if there is something either about the timing or the context of the OnVisible call to populate the variables. But why this affects some of the variables and not others, I have no idea.

 

AylardJ_0-1667857843717.png

Can anyone suggest something specific that I can look at?

 

Thanks,

James

Categories:
  • Verified answer
    AylardJ Profile Picture
    34 on at

    It seems that if I change these variables from context variables to global variables, they work. Which to me suggests there is an issue with either the timing or the scope of assigning values to the context variables. That feels a little broken, but I may be missing something. But making them global variables is not a big deal, so it is an easy enough fix.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @AylardJ,

    Glad that you have resolve this problem.

    Could you please mark your reply as an answer to help more users?

    Thanks for your cooperation.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard