Hi,
I have an app which is used to create training dates. So now I want to delete the completed training programs from the SPList and add the same data to new SPList based on the Enddate (if enddate < Today). I have one gallery, can we check this condition in items property of gallery or can we perform this on AppStart.
Thanks in advance.
Solved! Go to Solution.
@sindhureddy It would be better to do it in the OnStart of the App. You can use the following syntax,
ForAll(Filter(yourSPList, enddate < Today()),
Patch(otherSPList, Defaults('otherSPList'), ThisRecord);
Remove(yourSPList, ThisRecord)
)
@sindhureddy Try this (with EndDate is same in both SPList),
With({varRecords:Filter('Training Request List', EndDate<Today())},
ForAll(varRecords,
Patch(CompletedTrainings, Defaults(CompletedTrainings), ThisRecord);
Remove('Training Request List', ThisRecord)
)
)
@sindhureddy It would be better to do it in the OnStart of the App. You can use the following syntax,
ForAll(Filter(yourSPList, enddate < Today()),
Patch(otherSPList, Defaults('otherSPList'), ThisRecord);
Remove(yourSPList, ThisRecord)
)
@CNT Thanks for the reply. I am getting error for ThisRecord, Can you please help me with this.
@sindhureddy As the error says there is some name mismatch between EndDate and Enddate. Could you show me the full formula.
@CNT I have one SPList called Training Tracker App where all the requests are stored, now based on the end date I want to delete the training requests which have completed the trainings and move them to another SPList called(CompletedTrainings).
@sindhureddy Is the Column name spelt correctly in the CompleteTrainings sharepoint list? It must be EndDate.
@CNT Yes, EndDate is spelt same in both the lists but it's showing the below error so I tried with Enddate.
In the attached screenshots EndDate is spelt same in both the SPListsWhen EndDate is same in both SPList I am getting this errors
@sindhureddy Try this (with EndDate is same in both SPList),
With({varRecords:Filter('Training Request List', EndDate<Today())},
ForAll(varRecords,
Patch(CompletedTrainings, Defaults(CompletedTrainings), ThisRecord);
Remove('Training Request List', ThisRecord)
)
)
@CNT Thank you so much, By considering your formulas tried with this formula and it's working for me
Collect(CompletedTrainings,
ShowColumns(
Filter('Training Request List', EndDate < Today()), "ReqID","Category","StartDate","EndDate","Title","Trainer_Name","Mode")
);
User | Count |
---|---|
163 | |
89 | |
71 | |
64 | |
62 |
User | Count |
---|---|
210 | |
151 | |
97 | |
84 | |
66 |