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

Set some values to zero, restore other value from separate column

Two parts to this question. I'm trying to create a "Return All" inventory button that will

1- Set values in 4 data cards to 0

2-Reset value in the first data card to a value drawn from another column in the same spreadsheet/table.

 

For the first part, I have been able to use Patch to reset the value to 1, but when I try to set to 0, using the button returns a "False" value. How can I correct this?

 

For the second part, I have added a "Total" column to my inventory table after initially generating the app, and I'm not certain how to correctly draw the data from it to fill/reset a data card. I've screencapped what I have; trying to draw from the "Total" column to overwrite the "Storage Locker" data card when the button is pressed. The purpose is so that if my app users accidentally mess up the inventory significantly (adding or subtracting too many; can't remember how many we actually have), we can use the button to reset to the last time we did a physical inventory and recorded the tallies on the "Total" column. Does that make sense?

 

Tagging @EricLott if you have any thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Set some values to zero, restore other value from separate column

Hi @LauradeBoer ,

Could you please share a bit more about your scenario?

 

For your first question, could you please show more details about the error message? Based on the Patch formula that you mentioned, I think there is something wrong with it. 

Please consider modify your formula as below:

Patch(
      Testing,
      TestingGallery.Selected,
      {
          'With April': 0,
          'Storage Locker': Value(TestingGallery.Selected.Total)
      }
)

Note: Please refresh your Testing data source within your app manually before executing above Patch formula. I assume that the TestingGallery is connected to your Testing data source.

 

If you want to patch 0 back to the 'With April' column when the DataCardValue3 is blank, please consider modify above formula as below:

Patch(
      Testing,
      TestingGallery.Selected,
      {
          'With April': If(!IsBlank(DataCardValue3.Text), Value(DataCardValue3.Text), 0),
          'Storage Locker': Value(TestingGallery.Selected.Total)
      }
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Set some values to zero, restore other value from separate column

Hi @LauradeBoer ,

Could you please share a bit more about your scenario?

 

For your first question, could you please show more details about the error message? Based on the Patch formula that you mentioned, I think there is something wrong with it. 

Please consider modify your formula as below:

Patch(
      Testing,
      TestingGallery.Selected,
      {
          'With April': 0,
          'Storage Locker': Value(TestingGallery.Selected.Total)
      }
)

Note: Please refresh your Testing data source within your app manually before executing above Patch formula. I assume that the TestingGallery is connected to your Testing data source.

 

If you want to patch 0 back to the 'With April' column when the DataCardValue3 is blank, please consider modify above formula as below:

Patch(
      Testing,
      TestingGallery.Selected,
      {
          'With April': If(!IsBlank(DataCardValue3.Text), Value(DataCardValue3.Text), 0),
          'Storage Locker': Value(TestingGallery.Selected.Total)
      }
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: Set some values to zero, restore other value from separate column

That worked perfectly, thanks very much!

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,330)