Hi All,
I have text input in my screen which shows number of openings available for users to register for an event. Number of openings gets decremented by 1, when user registers successfully.
Text Input Default
If(Value(glbCurrentRecord1.'No of Openings Available')>0, glbCurrentRecord1.'No of Openings Available'&" openings left","Fully Occupied")
Patch formula when submit button is clicked
Set(
varPatchRecord,
Patch(
'Datasource',
glbCurrentRecord1,
{'No of Openings Available': Value(glbCurrentRecord1.'No of Openings Available') - 1}
)
);
Set(
glbCurrentRecord1,
varPatchRecord
);
The problem now is if number of openings left is 1, and if multiple users access the powerapp screen at the same time and register for an event, both users are able to register it successfully, which should not be the case.
How should I deal with this scenario? Any inputs would be helpful.
NOTE: Please take note that I am not using any form. Just placed controls in the screen and patching based on button click.

Report
All responses (
Answers (