Hi Power Apps Community,
I am a Newbie to this Power apps, i have been trying to build an app for the employees to Create or Update records every Month, and save them into the SharePoint list.
So if an employee comes and updates his value for the 1st time in the month then 15 new records with New YearMonth (Example: 2023-11) Stamp are Created, after that in that month (Example :2023-11) if he wants to update again then new records should not be created but the existing records values should be updated.
The create is working quick very well but update is the issue.
I have this formula on the Save Button,
If(
IsBlank(
LookUp(
'Row Arch Comp',
Employee = Gallery1.Selected.Employee && YearMonth = Text(
Now(),
"yyyy-mm"
)
)
),
// This is the create part where new records for that Month are Created
Patch(
'Row Arch Comp',
ForAll(
Gallery2.AllItems,
{
CompetencyTitle: CompetencyFullName,
TrainingTitle: TrainingName,
Employee: Employee_2.Text,
CompetencyScore: CmpScore_2.Text,
'Evaluator Email': EvalEmail_2.Text,
Evaluator: Eval_2.Text,
EmployeeEmail: EmpEmail_2.Text,
EmployeeID: EmpID_2.Text,
Site: Site_2.Selected.Value,
JobCode: JBC_2.Selected.Value,
JobCodeDescription: JBCD_2.SelectedText.Value,
EmployeeHireDate: EmpHD_2.SelectedDate,
TrainingValue: TrainingDropDown_2.Selected.Value,
YearMonth: Text(
Now(),
"yyyy-mm"
),
'Employee Marker': If(
CompetencyFullName = "QUA - FAR-FMR-SMR - Readiness Reviews",
"Yes",
""
)
}
)
),
// Here my requirement is that I want to Update the Values in the records if they are already created for the Current Month.
"I have Put this else condition below .Please have a Look :-)"
);
Notify(
"Success",
NotificationType.Success
);
Navigate(Screen1);
here i have tried the below in the Else Condition place but doesnot seem to work (i.e. Not updating the values into the SP List)
//This is the Code snippet used in the else Condition Place but this is not doing anything
Patch(
'Row Arch Comp',
LookUp(
'Row Arch Comp',
Employee = Gallery1.Selected.Employee && CompetencyTitle = Gallery2.Selected.CompetencyFullName && YearMonth = Text(
Now(),
"yyyy-mm"
),
ForAll(
Gallery2.AllItems,
{
'Evaluator Email': EvalEmail_2.Text,
Evaluator: Eval_2.Text,
EmployeeEmail: EmpEmail_2.Text,
EmployeeID: EmpID_2.Text,
Site: Site_2.Selected.Value,
JobCode: JBC_2.Selected.Value,
JobCodeDescription: JBCD_2.SelectedText.Value,
EmployeeHireDate: EmpHD_2.SelectedDate,
CompetencyScore: CmpScore_2.Text,
TrainingValue: TrainingDropDown_2.Selected.Value
}
)
)
)
Any Kind of assistance or help is heartfully appreciated 😊
Please help on this as this is crucial for me to complete by this week.
Thanks again 😊.