We want to change the status of a class record to "Inactive" when all courses associated with the class are completed by every participant.
Power Apps Implementation:
Check Completion:
- First, we determine if all courses for all participants are complete using a variable named
allCoursesComplete
. This variable should be set based on your specific logic, which typically involves checking if there are any courses still marked as incomplete.
- First, we determine if all courses for all participants are complete using a variable named
Update the Class Record:
- Using Power Apps, we can update the class status directly within the application when all courses are confirmed complete. Here is a simple and effective way to do this:
If(
allCoursesComplete,
Patch(
Classes,
LookUp(Classes, Session = GUID(passedClassId)),
{statecode: 'Status (Classes)'.Inactive}
)
)
If
Function: This checks ifallCoursesComplete
is true.Patch
Function: This updates the data source for class records,Classes
.LookUp
Function: This identifies the specific class by its session ID, ensuring we target the correct record.{statecode: 'Status (Classes)'.Inactive}
: This sets thestatecode
field to "Inactive". This syntax directly references the OptionSet value for "Inactive" within theClasses
data source.
No comments:
Post a Comment