cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
denisbalakirev
Level: Powered On

Creating + - buttons for change value in cells (with Excel table as a DataSource)

Hi Guys,

 

I am new for a PowerApps and cant find answer on my question.

 

I have a Gallery with Excel table DataSource(stored in SharePoint) Can i made ±1 buttons for making quantity changes in cells ?

 

I am tryied to use "Patch" function, but, it is always gives me an error.  

 

For example: Patch(Table6,Subtitle4,{QuantitySmiley Frustratedubtitle4+1} I tried to use differnet ways (Gallery, NameOfColumn in Table, ThisItem ) 

 

Can you help me with this little issue ?

3 REPLIES 3

Re: Creating + - buttons for change value in cells (with Excel table as a DataSource)

Looks like you need to reference the record before you do the +1. I'm assuming the record is displayed in a text input field so you need to wrap it in value too to make sure it's numeric.

So the path should be
Patch(excelsource,therefore,{Quantity: value(Subtitle4.text)+1})

This should work, if not let me know and I'll screen share and help.
denisbalakirev
Level: Powered On

Re: Creating + - buttons for change value in cells (with Excel table as a DataSource)

Hi,

 

As i know now, we can't use Excel Files stored on SharePoint as a Data Source.

 

So, maybe you can help me with Sharepoint List ? 

Super User
Super User

Re: Creating + - buttons for change value in cells (with Excel table as a DataSource)

Hi @denisbalakirev

 

Based on your screenshot, the code for the + button would look like this:

Patch('Cartridges Storage', 
      BrowseGallery1.Selected,
      {Quanttity: Value(DataCardValue2.Text) + 1}
)

The code for the - button would look like this:

Patch('Cartridges Storage', 
      BrowseGallery1.Selected,
      {Quanttity: Value(DataCardValue2.Text) - 1}
)

The Patch function expects 3 arguments: a data source, the record to update, and the data values to patch.

In a standard auto-generated app, BrowseGallery1.Selected is the record that you want to update. In your example, DataCardValue2 is the control that displays the current quantity (as shown in the screenshot), so that's the reason why the formula refers to this control.

 

image.png