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 / +1 to a fields number ...
Power Apps
Answered

+1 to a fields number when pressing a button

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

I am developing an application, where it is really important to understand how many times the editform has been saved. However, I have two save buttons in my editform, one that merely saves the data that has been stored in the form, but stays on the page, and another, which saves and takes the user to the mainpage.

 

I would only like to have the latter add a number, hence I tried the below formula in the Update Property of the datacard. But that does not seem to work:


If(KaydetAndExit.Pressed, Value(ThisItem.EditCount) + 1,EditCountDataCard.Text)

 

The below functions works for whenever a person saves the editform, however, the problem is users might save the form often if they go for a break etc. But we only want them to have a number added when the final form is finished and the Save+GoMainPage gets clicked.

 

 

If(Form1.Mode = FormMode.Edit, Value(ThisItem.EditCount) + 1, Form1.Mode =New, Value(ThisItem.EditCount) + 1,EditCountDataCard.Text)

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,926 Most Valuable Professional on at

    Hi @Anonymous ,

    Firstly the edit bit that works - I assume this is on the Update property of the card

    If(
     Form1.Mode = FormMode.Edit, 
     Value(
     ThisItem.EditCount
     ) + 1, 
     Form1.Mode =New, 
     Value(
     ThisItem.EditCount
     ) + 1,
     EditCountDataCard.Text
    )

    So what you need to know is if the user has saved on the screen and if they come back to the screen and save again, it will not add another to the count.

    So if you set a context variable to the save button 

    UpdateContext({vSaved:true})

    it will set this on the first save - the Update of the card could then be

    If(
     !vSaved && Form1.Mode = FormMode.Edit, 
     Value(
     ThisItem.EditCount
     ) + 1, 
     !vSaved && Form1.Mode =New, 
     Value(
     ThisItem.EditCount
     ) + 1,
     EditCountDataCard.Text
    )

    Would this work for you?

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more. It also closes the item.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz,

     

    Thank you sir, this worked for me!

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard