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 / Parent.Default and Glo...
Power Apps
Answered

Parent.Default and Global Variables with a Button Counter

(0) ShareShare
ReportReport
Posted on by 29

Hello,

 

I created a counter with buttons that either +/- a text input with the Set(GlobalVariable, GlobalVariable+1) on the button and in the Text Input default field I have GlobalVariable. Simple enough and works as expected. The problem is that this is a form that submits to a sharepoint list and when I navigate from the gallery portion of the app to the selected item (editform) it does not populate the list data of that item. 

 

tbush33_0-1601001972508.png

 

I tried changing the default value on the text input to: If(varMode="Edit", Parent.Default, GlobalVariable)

The varMode is a global variable used in a tutorial I found online that sets the onVisible property of the form to either NewForm or EditForm based on a button the user selects.

 

The problem with this method is that it does not allow me to edit the field with my counter buttons because it does not recognize the field as GlobalVariable anymore.

 

My question is, do any of you know a way to use a counter button to increase or decrease a number in a text input that can be edited later?

 

Thanks,

Travis

Categories:
  • eka24 Profile Picture
    20,925 on at

    Is the Textbox part of the form or independent. Also can you show the formula for the variable

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • tbush33 Profile Picture
    29 on at

    I would like it to be part of the form. It is in one of the data cards for the form. Here is the formula for the varMode Global Variable:

     

    If(varMode="Edit",EditForm(Shift_Report),NewForm(Shift_Report))

     

    Then I have a Create New button that has Set(varMode,"New")

     

    and then the right arrow in the gallery to edit the item Set(varMode,"Edit")

     

    Thanks!

  • tbush33 Profile Picture
    29 on at

    I just tried using updateContext({Counter:Counter+1}), but I think that is just the same as using a Global Variable because it still makes me use the default property on the text input.

  • Verified answer
    tbush33 Profile Picture
    29 on at

    I think I figured it out....I am not sure if it is the best method, but it is working in my situation.

     

    I did not realize that the global variable did not need to be assigned to a control. After determining I would be able to just add the parent.Default to the global variable (parent.Default + GlobalVariable). It was that simple.

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard