cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Renee
Helper I
Helper I

Resetting calculated PowerApps controls to 0 when creating a new SharePoint Item

Hi

I have created a number of different calculations which take the results of a choice control and look up the corresponding value is another SharePoint List.  All works perfectly except the values do not reset automatically - one has to go to the next tab and back to the form again to see the change.  In addition the calculations do not rest to 0 when a new item is created.  Essentially, they are not refreshing where required.  

I have a number of buttons at the top of the form and to move between forms, one clicks on the button. 

The formula in the calculations are:

Lookup('name of list',name of field =value, if(variable with the result of the choice field ="value", lookup a specific column, default value))

I have set the variables in OnSelect for the Gallery in the form. I have tried using reset(txt box with calculation) in the OnSuccess of the form but this does not reset them.

Thank you to all who have contributed to previous posts of mine - I find this an invaluable resource!!!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @PG_WorXz10 

The control I would like to refresh is a look up value based on a drop down in the form.  it looks up this value in another connected table. If I add a new variable onto the Reset property of this control, it does not recognise the variable and underlines it in red.  Do I need to set this variable somewhere first and if so where?  Thanks again.  I have already set a variable to store the value selected in the drop down. The reason why I used Set(varAck1, txtAck1) was to set the variable because if I don't, it is not recognised.  I am sure that I am missing something. Thanks again.

I am having the same issue with another lookup field which looks up a person's name and inserts the corresponding email address.  It updates if I move off the screen but does not update automatically once the person's name is selected.

Thanks again.

I thought it may be clearer by adding the info into a document.

View solution in original post

6 REPLIES 6
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @Renee ,

 

You can also try adding a variable in Reset property and when ever you required to reset this field value just invert this variable value there like below. 

Set(vaiableName,!vaiableName)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi

My apologies but I am a real beginner at all of this! I am not sure where or how to add this.  I am used to Nintex and try to apply similar principles - not the best way to do things.  Before I had on the On Select command of the Button to display the form:

Set(varAck1,txtAck1.selected.value) and in the On Save of SharePointIntegration, I have added Set(valAck1,!valAck1) but it is saying that there is an error in the formula - It is underlying the second valAck1 in red.                                                                                                                      

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @Renee ,

 

Please try like below.

1. Select the field or control which you want to reset and add a variable in the Reset property as mentioned below 

PG_WorXz10_0-1630396362302.png

 

2. On which ever trigger you want to reset the field value add below set function.

 

Set(varReset,!varReset)

 

This way you will be able to reset the control. 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Thank you.  I have done what you have said and tried to add it to OnNew for sharePointIntegration but that didn't work - I then tried to add it to the Save button but it does not like - Set(varAck,!varAck) - it displays a red line underneath the second one.  Not sure where it add it! 

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @Renee ,

 

Please don't use varAck as this variable is already used in your form and it is holding txtAck1.selected.value which is not Boolean. 

Please use a new variable.  

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 

The control I would like to refresh is a look up value based on a drop down in the form.  it looks up this value in another connected table. If I add a new variable onto the Reset property of this control, it does not recognise the variable and underlines it in red.  Do I need to set this variable somewhere first and if so where?  Thanks again.  I have already set a variable to store the value selected in the drop down. The reason why I used Set(varAck1, txtAck1) was to set the variable because if I don't, it is not recognised.  I am sure that I am missing something. Thanks again.

I am having the same issue with another lookup field which looks up a person's name and inserts the corresponding email address.  It updates if I move off the screen but does not update automatically once the person's name is selected.

Thanks again.

I thought it may be clearer by adding the info into a document.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (2,789)