Hello!
I have this sharepoint list:
I am saving data by a button (It is not important for my question, just want to cover everything):
Switch(
typDovolene,
"Vacation",
Collect(
VacationTracker,
{
Title: User().Email,
StartDate: StartDate.SelectedDate,
EndDate: EndDate.SelectedDate,
LenghtInDays: Value(lblDaysOfVacation.Text),
TypeOfVacation: Text(typDovolene),
DepartmentCopy: Text(
LookUp(
Employees,
NameOfEmployee = User().Email
).Department
)
}
),
"Overtime",
Collect(
VacationTracker,
{
Title: User().Email,
StartDate: StartDate.SelectedDate,
TypeOfVacation: Text(typDovolene),
HoursOvertime: drpOvertime.SelectedText.Value,
DepartmentCopy: Text(
LookUp(
Employees,
NameOfEmployee = User().Email
).Department
)
}
),
"Business Trip",
Collect(
VacationTracker,
{
Title: User().Email,
StartDate: StartDate.SelectedDate,
EndDate: EndDate.SelectedDate,
LenghtInDays: Value(lblDaysOfVacation.Text),
TypeOfVacation: Text(typDovolene),
DepartmentCopy: Text(
LookUp(
Employees,
NameOfEmployee = User().Email
).Department
)
}
),
"Halfday",
Collect(
VacationTracker,
{
Title: User().Email,
StartDate: StartDate.SelectedDate,
TypeOfVacation: Text(typDovolene),
HalfdayType: drpHalfday.SelectedText.Value,
DepartmentCopy: Text(
LookUp(
Employees,
NameOfEmployee = User().Email
).Department
)
}
)
);
Set(
daysRequested,
RoundDown(
DateDiff(
StartDate.SelectedDate,
EndDate.SelectedDate,
Days
) / 7,
0
) * 5 + Mod(
5 + Weekday(EndDate.SelectedDate) - Weekday(StartDate.SelectedDate),
5
) + 1
);
If(typDovolene = "Vacation", Patch(Employees, LookUp(
Employees,
NameOfEmployee = User().Email
), {VacationValue: Value(lblAvaliableDays.Text)}));
Navigate(
Main,
Fade
);
There is a column called EndDate and StartDate and the input is from two Date pickers.
I need a code, which will switch a whole row to another sharepoint list called VacationTrackerDone everytime when Today() > EndDate and delete this row from the VacationTracker. Basically just move it from one sharepoint list to another.
I probably know, how to write the code, but I have no idea where to type it.
Could someone help?