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 Apps
Unanswered

defining variables

(0) ShareShare
ReportReport
Posted on by

I am trying to define a variable in a button with function Set(myvar, "xyz");
I expect when I use 'myvar' it should print 'xyz', but it is showing nothing, and when I checked on the variable list I can see the only myvar with no text assign to it.
can anyone suggest how can i fix the issue?

 

thanks 

Abhishek

image.png

Categories:
I have the same question (0)
  • moritz0815 Profile Picture
    201 on at

    Set only defines and/or sets the variable. If you want to show the variable's text, you need to insert a lable und set myvar as text property

  • abhishek20531 Profile Picture
    8 on at

    thank you for addressing the issue.
    I inserted text label, set myvar as the text property, still its not showing the value of variable, please refer to attached screenshot.

    abhishek20531_0-1690756065232.png

     

  • CarlosFigueira Profile Picture
    on at

    Hello @abhishek20531 have you clicked the button? You have an expression in the button that will set the variable 'myvar' to the value you want ("xyz"), but it will only be executed when the button is selected (it is defined in the button's OnSelect property). Until a variable is set, its value is Blank, which is probably what you are seeing in your app.

    Hope this helps!

  • abhishek20531 Profile Picture
    8 on at

    Hi, @Carlos , I did select the button. I can see it recognizing the variable, but its not storing the value. I tried every possible thing. I checked on different forums, view few videos. Even after replicating same steps, I am not able to identify the bug.

    abhishek20531_0-1690765131565.png

     

  • abhishek20531 Profile Picture
    8 on at

    HI @moritz0815 , I also tried using table, attached in the screenshot, the issue is still the same, it can recognize the variable because the syntax is right but still can't store the value,

     

    abhishek20531_0-1690765847184.png

    abhishek20531_1-1690765880947.png

     

  • moritz0815 Profile Picture
    201 on at

    I actually believe, just like @CarlosFigueira wrote, that you didn't press the button. Hold down the 'Alt' key and click on your button.

  • abhishek20531 Profile Picture
    8 on at

    @moritz0815  thank you. I have been so silly, I was missing to hold the Alt key

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard