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

Use + and - Sign to update quantity

So I want to just add a plus and minus button for the quantity field.  I just can't get it to work and I've been modeling it from this post https://powerusers.microsoft.com/t5/General-Discussion/and-Button-to-add-and-subtract-from-a-Quantit....  No matter how I change the syntax, I just can't figure out what I'm doing wrong. 

Backround on data:

Orignally I had everyting in an SP list.  I ended up fining out I couldn't use the search function with SP lists in order to use the textsearchbox to search more fields.  With SP lists I was only able to get filter to work and at that, filter is only good for searching one column.  At any rate.  I ended up exporting the SP list data to an excel file on my local drive.  From there I used the "excel static data" upload function.  I found out that my lists are still being updated even though I'm using the data pulled from a static excel sheet that's pulling data from the list.  I hope that gives enough information to get this bad boy tackled.  Thanks guys.apps.PNG

 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Use + and - Sign to update quantity

@Salamander94 

As I mentioned in the other post, if you're having particular issues with the SharePoint searches and other functions, just post in this forum and help is on the way.

 

As for the current situation, just to be clear:

1) Your inventoryserver datasource is the name of a Table that is in your static Excel file, and you imported the information via the "Imported from Excel" data connection?

2) when you use the formula you stated in the original post, you should have gotten a warning under the inventoryserver name in the formula stating the the data source is read-only.

 

As for what to do...options are:

1) in your App startup (or some other location that is suited to the scenario), put a ClearCollect(colLocalList, inventoryserver).  This will load all the values into the collection colLocalList.  You can then replace places where you reference the inventoryserver (like the patch formula you had before) with colLocalList.  You will be able to perform the operation you had before on that collection.  However, none of this will reflect back to the Excel file as it is not writable.

2) Use the Excel file as a read/write datasource.  Create a connection to the Excel file through your OneDrive connection and use it as-is

3) Go back to SharePoint and post some issues you are having with that.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

9 REPLIES 9
Highlighted
Super User III
Super User III

Re: Use + and - Sign to update quantity

@Salamander94 

This post seems like the same post as your other one.  Perhaps an accidental duplicate.

Please check out the reply I made there.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Helper IV
Helper IV

Re: Use + and - Sign to update quantity

Thank you for your comment.  I am new to the community as you can already see and I haven't been able to figure out how to either change the name of my first post or delete it.  The name is completely misleading and I am not sure how that name came about since it's not what I typed.  I made this repost in order to undo any confusion from the name to the post. 

Highlighted
Super User III
Super User III

Re: Use + and - Sign to update quantity

@Salamander94 

No worries.  Yes, I was wondering what the title of the other had to do with the content.

 

I'll move the discussion over to this thread and we'll get the other one removed.

Below is the response in the other thread:

--------------

Try changing your formula to this:

Patch(inventoryserver, ThisItem, {Quantity : ThisItem.Quantity +1})

 

On your background info - both Filter and Search are perfectly capable of being used on many columns at once.  If you decide to move back to SharePoint and want to resolve that issue, just post a message in this forum.

 

I hope that is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Helper IV
Helper IV

Re: Use + and - Sign to update quantity

Okay then just disreguard my last post on that page.

 

Okay I still can't get this to work. The data is coming from the static excel sheet. I couldn't get it to work with that hence the reason I was trying the source of that excel's data. I.E. "inventoryserver"

Patch(inventoryserver, ThisItem, {Quantity: ThisItem.Quantity + 1})
Highlighted
Super User III
Super User III

Re: Use + and - Sign to update quantity

@Salamander94 

If this information is in a static datasource (I am assuming that is that your inventoryserver is defined as) then you will not be able to patch it or update it.

My question would be...if it is static, why would you update it?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Helper IV
Helper IV

Re: Use + and - Sign to update quantity

Okay so I couldn't get the textsearchbox to search more than one column while using a SP list so I exported it to excel.  Then I was able to use the search funciton for multiple columns instead of one using filter to only search one.  I need the data to update within the app at leasst if no where else. 




Highlighted
Super User III
Super User III

Re: Use + and - Sign to update quantity

@Salamander94 

As I mentioned in the other post, if you're having particular issues with the SharePoint searches and other functions, just post in this forum and help is on the way.

 

As for the current situation, just to be clear:

1) Your inventoryserver datasource is the name of a Table that is in your static Excel file, and you imported the information via the "Imported from Excel" data connection?

2) when you use the formula you stated in the original post, you should have gotten a warning under the inventoryserver name in the formula stating the the data source is read-only.

 

As for what to do...options are:

1) in your App startup (or some other location that is suited to the scenario), put a ClearCollect(colLocalList, inventoryserver).  This will load all the values into the collection colLocalList.  You can then replace places where you reference the inventoryserver (like the patch formula you had before) with colLocalList.  You will be able to perform the operation you had before on that collection.  However, none of this will reflect back to the Excel file as it is not writable.

2) Use the Excel file as a read/write datasource.  Create a connection to the Excel file through your OneDrive connection and use it as-is

3) Go back to SharePoint and post some issues you are having with that.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Use + and - Sign to update quantity

Okay, so I've done what you said and moved all of my data over to OneDrive.  Now the plus shows no error, but I don't actually see it adding + 1 to the quantity.

Patch(items1, ThisItem, {Quantity: ThisItem.Quantity + 1})

Is the Code I'm using.

Highlighted
Helper IV
Helper IV

Re: Use + and - Sign to update quantity

Update:  IT WORKS!  I just spaced the semi colon from the "{Quantity" part.  Thank you so much for your time and help.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (10,439)