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

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 44 members 4,134 guests
Please welcome our newest community members: