I have the following power app form:-
now i want to increase the ScoreGreenPoint by 1 when the user clicks on the "+ Green" button? is this possible?
Thanks
@RandyHayesthat also makes sense to me now.. thanks
Actually you will want to Set(varGreenScore, Blank())
If you set it to 0 then this formula:
Coalesce(varGreenScore, Parent.Default, 0)
Will always show 0, because varGreenScore is NOT blank.
Coalesce returns the FIRST non-blank value in the list of parameters. If you set that variable to 0, then varGreenScore will not be blank and thus the rest will never evaluate properly.
If you set it to Blank, then it will work properly.
@RandyHayesok makes sense now... so i need to define
Set(varGreenScore, 0)
on the onsuccess of the form, so i will be fine? is this correct? or you are against using variables at all?
In the context of SharePoint Integration. When you submit the form and it closes (RequestHide()) it does not actually close the Form/app, it simply hides it. If you close the browser and then go back to the list, the variables will be gone. That is because the closing of the browser caused the "hidden" app to close.
When you click to "new" a record, it is just making the hidden app visible - so it will not have closed and the variables would still have their values.
It is best not to rely on this concept for maintaining variable state as, as mentioned, once the browser is closed or refreshed, the form/app will go away and no longer have its values.
@RandyHayes can you explain this in more details? what do you mean by close the app? as i test this where i submit the form which will close the app >> but when i click on New button a new form will open and the form will use the variable from the previous form submission ...so the variable will not lose its value when we close the app...
Variables do not lose their values unless you close the app.
In your OnSuccess of your Form, you should set the variable to Blank()
I assume you are doing a SubmitForm somewhere in order to save your form data?
@RandyHayesyou are correct .. so where i need to set Blank() ? also why this happen at the first stage? should not the variable life time ends when we close the form?
You will want to use the Blank()
If not, then if you open one record and let's say increment to 10, then open another record, it will show 10 and not the actual record value.
You are using the variable. You have used this formula in your Default property:
Coalesce(varGreenCount, Parent.Default, 0)
Coalesce is the function that evaluates varGreenCount and Parent.Default then determines which value to display.
On using the Coalesce, to make sure I understand, it works on the presumption that only one will have a value at any given time other than blank, correct?
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2