Good Afternoon! Everyone. I have this search bar in my app in powerapps. When I put in a badge number it pulls up a pop up which contains a Check In/Out button. So when I press the button once it checks in the person and change the status column value in my sharepoint list to Checked-in and when pressed again, the button, it Checksout the person and change the status column value in my sharepoint list to Checked-out.
So what I want to achieve is to make the pop-up disappear or turn false, once the button is pressed for the first time (for check in) and then after pulling up the same record through search, Now if I press the button the second time for checking out then person it should make the popup turn false or disappear again. Any help would be appreciated. Thank You.
This is the display:

And here is my code:
UpdateContext({RecordToUpdate: LookUp(Appointments, Associate.Value = Associate_Number.Text)});
Switch(
RecordToUpdate.Status.Value,
Blank(),
Patch(
Appointments,
RecordToUpdate,
{Status: {Value: "Booked"}}
),
"Booked",
Patch(
Appointments,
RecordToUpdate,
{Status: {Value: "Checked-in"}}
);
Notify("You have Checked-in Successfully", NotificationType.Success, 5000),
"Checked-in",
Patch(
Appointments,
RecordToUpdate,
{Status: {Value: "Checked-out"}}
);
Notify("You have Checked-out Successfully", NotificationType.Success, 5000),
"Checked-out"
);