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 / Variables Assignment I...
Power Apps
Answered

Variables Assignment Issue

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a strange and specific issue that is making the value of my variable 0 no matter what number is written in the text box it is coming from. There are a few layers to this and I will explain below, any help is appreciated.

 

In the OnStart property of the App, I have a variable declared as this:

Set(varIncrement, Value(Last(DowntimeDB).Title))

 

This variable is then assigned to the text input "txtNumber_3" as Value(varIncrement).

 

Upon clicking a button, varIncrement increases by 1 value using this code:

Set(varIncrement, varIncrement + 1)

 

The problem begins here. I am trying to create a new variable from the value inside txtNumber_3 for another screen, the code is:

Set(varExtraIncrement, txtNumber_3.Text)

 

When I try to assign this new variable to a new text input, the value is always 0 no matter what. Am I doing something wrong throughout this whole process of variable overriding? Again, any help would be appreciated as I'm stuck!

 

Thanks. 

 

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,481 Most Valuable Professional on at

    Where are you doing the create for your second variable?  I just did a mockup of your issue and it works fine for me if I set the variable as I navigate to the next screen like this

    Set(varExtraIncrement, TextInput1.Text);Navigate(Screen1,ScreenTransition.Fade)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Pstork1 thanks for the response. In the first screen before proceeding to the next screen, I have a Proceed button. Here in the Proceed button, I am declaring the new variable varExtraIncrement, just as you have shown in your response.

    I then put Value(varExtraIncrement) in the text input on the next screen, the value always being 0.

     

    I'm still unsure why this is happening. 

  • Pstork1 Profile Picture
    69,481 Most Valuable Professional on at

    AS you can see from my code I'm doing the same thing and it works on my setup.  Is that the only Set you have for VarExtraIncrement?  Or could it be being reset by some other action?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    No, varExtraIncrement is being set only once in the Proceed button. I am sure it is not being reset anywhere as the code I have shown in the initial question are the only places varIncrement and varExtraIncrement are declared and manipulated in the app.

     

    Could it be something to do with varIncrement being overwritten to increment the variable by one? Or is that not the issue? 

  • Verified answer
    Pstork1 Profile Picture
    69,481 Most Valuable Professional on at

    That shouldn't be an issue unless you are trying to increment it at the same time you are setting varExtraIncrement.  As I said, I'm not able to reproduce your issue.  It works fine in my setup so I'm not sure how to help.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This actually seems to be the issue. The Proceed button contains the code for both incrementing varIncrement and setting varExtraIncrement. I will experiment with this now and see if I can resolve it. Thank you for your help. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This worked well. I placed the code for declaring varExtraIncrement elsewhere and it worked. Thank you for your 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 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard