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});

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,039)