cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PerKou
Regular Visitor

Problem with updating value on number type column on SharePoint

Hello I am trying to update a number type column on SharePoint through the app. More specifically the column on SharePoint keeps the "balance" of the user and I wish to update it by subtracting from current value the amount from a field on the app.

 

the name of the SP list is "Balance" and the column name "Balance"

 

 

Patch(Balance,
LookUp(Balance, Title=Gallery1.Selected.Title),
{
Balance: Balance - Value(TextInput3.Text)
}
)

 

It seemed an easy thing to do but I cannot get the current value of the field on SharePoint, I am getting error on the underlined part mentioning: 

Invalid argument type. Expected one of the following: Number, Text Boolean

 

thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

just do this:

 

Patch(Balance,
LookUp(Balance, Title=Gallery1.Selected.Title),

{

Balance: LookUp(Balance, Title=Gallery1.Selected.Title,Balance)- Value(TextInput3.Text)

}


)

View solution in original post

12 REPLIES 12
C-Papa
Super User
Super User

try

 

Patch(Balance,
{ID:Gallery1.Selected..ID},
{
Balance: Value(Balance) - Value(TextInput3.Text)
}
)

zmansuri
Super User
Super User

Can you try this?

 

Patch(Balance,
LookUp(Balance, Title=Gallery1.Selected.Title),
{
Balance: Value(Value(Balance) - Value(TextInput3.Text))
}
)

eka24
Super User
Super User

Remove Balance from the Value as:

Patch(Balance,
LookUp(Balance, Title=Gallery1.Selected.Title),
{
Balance:  Value(TextInput3.Text)
}
)

 

Not

Patch(Balance,
LookUp(Balance, Title=Gallery1.Selected.Title),
{
Balance: Balance - Value(TextInput3.Text)
}
)

 

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

jbrit2020
Super User
Super User

Hi there, how many sharepoint lists are you using? Are you doing a Lookup between lists? If not, get rid of the lookup. 

 

The other thing you need to tell the Patch is which balance you're looking at in here so if you really must use Lookup this is roughly what you need to do:

{

Balance: LookUp(Balance, Title=Gallery1.Selected.Title,Balance)- Value(TextInput3.Text)

}

But I strongly advise you to steer away from the Lookup due to performance issues that it can bring. If you're only using one Sharepoint table, create a variable for the gallery item instead of a lookup.

He wants to find the delta between balance and text input so he needs to perform the subtraction somewhere.

PerKou
Regular Visitor

thx, I am getting the same error

thx, I am getting the same error

Why are you using Lookup? do you have multiple sharepoint lists?

PerKou
Regular Visitor

I want to subtract Value(TextInput3.Text) from the current value on SP. Not just replace it with Value(TextInput3.Text)

thx

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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