web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Duplication in SharePo...
Power Apps
Unanswered

Duplication in SharePoint backend.

(0) ShareShare
ReportReport
Posted on by 41

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...

N03L_0-1671197642129.png

 

and here's the existing filter on one of the drop down boxes. They're identical in all but name...

N03L_1-1671197728755.png

(thanks to @cha_cha for the guidance on the filters)

Thanks in advance.
N03L.

Categories:
I have the same question (0)
  • N03L Profile Picture
    41 on at
    Re: Duplication in SharePoint backend.

    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.

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: Duplication in SharePoint backend.

    @N03L 

    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.

     

     

  • N03L Profile Picture
    41 on at
    Re: Duplication in SharePoint backend.

    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?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: Duplication in SharePoint backend.

    @N03L 

    Anything is possible in this best of all possible worlds.

    raining.gif

     

  • N03L Profile Picture
    41 on at
    Re: Duplication in SharePoint backend.

    Thanks.
    Love the Marty Feldman 'obsession' by the way.
    Nice to see the classics being kept alive.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard