cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Filistyn
Helper V
Helper V

Adding a Value to a column in sharepoint list

Hello!

 

I have this sharepoint list:

databaze.png

 

I am working on time off app and column "VacationValue" is a value, that sets number of free days each employee has. Every manager can see their staff's time off requests in a gallery. Manager can either accept the request or decline. My question is, if he declines, how to add back those Vacation days, since I have already abated them from the VacationValue value. I have tried this on the decline button: 

 

Patch(Employees, {VacationValue: VacationValue + (ThisItem.EndDate - ThisItem.StartDate)})

 

But it does not work.

 

Someone help please

 

1 ACCEPTED SOLUTION

Accepted Solutions
Filistyn
Helper V
Helper V

Nevermind I have solved it with this formula:

Patch(Employees, LookUp(Employees, NameOfEmployee = ThisItem.Title), {VacationValue: LookUp(
      Employees,
      NameOfEmployee = ThisItem.Title
   ).VacationValue + ThisItem.LenghtInDays});

View solution in original post

2 REPLIES 2
Filistyn
Helper V
Helper V

I just realized, that there is a problem. The gallery is a list of a different sharepoint listasd.png

So the button wont work, for which item in the first database he should those d

Filistyn
Helper V
Helper V

Nevermind I have solved it with this formula:

Patch(Employees, LookUp(Employees, NameOfEmployee = ThisItem.Title), {VacationValue: LookUp(
      Employees,
      NameOfEmployee = ThisItem.Title
   ).VacationValue + ThisItem.LenghtInDays});

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,468)