Hi.
I know there are quite a few instances of very similar questions (here's one) but I can't find any that help me progress with my issue.
I've created a booking system for hot desks and parking spaces with a filter on the available desks and parking spaces (SharePoint Lookup columns connected to dedicated SharePoint lists), driven by the SelectedDate in a Date Picker control.
That's all working nicely but when I tested two users selecting the same options from the drop downs for the same date, both items were successfully written (patched) to the backend list.
My question is, how do I modify my Submit button code to do a quick, final check that the selections are still valid before 'patching' the values into the list?
Is that the best solution to this?
I've tried a ClearCollect based on the same filter values in the drop downs, just to see if the filtered items available can be pulled into a 'Collection' as well as being used as the 'items' in the drop down boxes, but the results don't match and I can't see why.
I'd also struggle to construct the If statement if the selections made were found to be in the list already.
Can anyone spare the time to help a newb out?
Here's a screen shot of the Submit code...
and here's the existing filter on one of the drop down boxes. They're identical in all but name...
(thanks to @cha_cha for the guidance on the filters)
Thanks in advance.
N03L.
Thanks.
Love the Marty Feldman 'obsession' by the way.
Nice to see the classics being kept alive.
Thank you so much @Drrickryp
You're a wonderful human being. 😊
I've got past that issue but have not managed to recreate the problem since implementing your fix.
It now seems to automatically select the next available pair of values from the lookup lists that the drop downs are connected to and just completes the 'Patch' with those values rather than display the 'Notify' text.
As I'm trying to troubleshoot that, I thought to add the values that are being passed on the confirmation screen (I don't know why I didn't think to do that before but...) and it's intermittently holding those values and, more often than not, resetting them to their defaults after displaying them correctly for less than a second.
I have got a 'Reset' function on the back button but this is happening before that's pressed.
Any ideas how or why this might be intermittent if not why it's happening at all?
I hate intermittent!
Thanks again.
N03L
EDIT:
The 'Notify' text has just shown up for the first time today, and the 'Patch' behaviour was halted, as expected, but from a different laptop.
Could something be cached on the laptop I've been building the app on?
Basically it would be
If(
IsBlank(
LookUp(
yourlist, Desk.ID=Dropdown_Desk.Selected.ID &&
'Parking Space'.ID= Dropdown.Parking.Selected.ID &&
Reservation_Date=Datepicker.SelectedDate
)
), Patch(... ,
Notify("This space and desk is already scheduled for someone else", Error
)
)
for both desk and parking space. If it were either/or then the formula would be different.
Is bumping still allowed on the internet?
I don't want this to get lost due to people focusing on what's been posted more recently.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.