Showing results for 
Search instead for 
Did you mean: 
Not applicable

Patch calculated value to SP list using LookUp function


Background info:
I'm building an PowerApp to track time for multiple employees. The daily inputs go to my first SP list.

To check if the employee has overtime (and can take a day off) the working hours are compared to their daily hours (depending if they work full time or part time) based on the current day. The daily target is saved in a second SP list ("MA_Wochenarbeitszeit").


I'm currently using an edit screen and only the difference of the hours is visible (but is on Displaymode.View). The hours difference is automatically calculated in the App and I want to patch the calculated value to the one row in my second SP list that belongs to the logged in user (and update the content of the column every time they track time).


I use the following code (OnSelect of the IconBackarrow):

Patch(MA_Wochenarbeitszeit; LookUp(MA_Wochenarbeitszeit; Mail=UserEmail); {Differenz:Stundendifferenz})

The list is called "MA_Wochenarbeitszeit", the column in the list with the mail adress is called "Mail", the difference of hours (actual amount minus target) should be in the column "Differenz", the cell in the PowerApps Edit screen is called "Stundendifferenz"


Why isn't this working?


The "error code" is:

the requested operation is invalid. Object must implement IConvertible


Thanking you in anticipation



Accepted Solutions
Not applicable

It works with:

Patch(MA_Wochenarbeitszeit; LookUp(MA_Wochenarbeitszeit;UserEmail=Mail); {Differenz:Int(Stundendifferenz)})

View solution in original post

Super User
Super User

Stundendifferenz, is it an int, string, float?
And Differenz?

If they are both int or float, try that:


Patch(MA_Wochenarbeitszeit; LookUp(MA_Wochenarbeitszeit; Mail=UserEmail); {Differenz:Value(Stundendifferenz)})


If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,

Gonçalo Nogueira

Check my LinkedIn!

Buy me a coffee!

Check my User Group (pt-PT)!

Last Post on Community

My website!

Not applicable

@Nogueira1306thanks for your answer


Stundendifferenz is float (i.e. 37,07 or ##,##)

Differenz is also float (same)


I already tried this code before, sadly, it doesnt work

Patch(MA_Wochenarbeitszeit; LookUp(MA_Wochenarbeitszeit; Mail=UserEmail); {Differenz:Value(Stundendifferenz)})

The error code says

text or number expected

"Value: Stundendifferenz" is underlined in red

Show em how you create that var, the Stundendifferenz var. Or if it is a text input or not



Not applicable

It is a text input with the format "number", its default value is



(in english: ('overtime of the last month' + 'actual amount') - 'target')

Patch(MA_Wochenarbeitszeit; LookUp(MA_Wochenarbeitszeit; Mail=UserEmail); {Differenz:Value(Stundendifferenz.Value)})


Not applicable

Now the whole part


 is underlined in red

Not applicable

It works with:

Patch(MA_Wochenarbeitszeit; LookUp(MA_Wochenarbeitszeit;UserEmail=Mail); {Differenz:Int(Stundendifferenz)})
Not applicable

@Nogueira1306  thanks for helping 🙂

Helpful resources

Ignite 2022


Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,561)