Getting data from 3 sharepoint lists in a delegable way

Iron Contributor

I have three SharePoint lists, as follow:-

 

1) BookingCalendar list. with these fields; ID, StartDate, EndDate

2) Network. With this field; ID

3) BookingCalendarNetwork. With these fields; ID, BookingCalendarID & NetworkID.

 

So a booking calendar can have multiple networks and a network can be associated with multiple booking calendars.

 

Now when creating a new booking calendar, i want to check for any conflict, the conflict can happen,

 

1) if a network inside the booking calendar is already been used as per the BookingCalendar StartDate and EndDate.

 

So, when creating or editing a booking calendar,  i did this to get all the BookingCalendar/s which are already busy during the current booking calendar + get the networks for the current booking calendar (the items selected inside the Networks combbox inside the Booking Calendar form) that is been created/edited:-

 

 

//check for booking calendar conflicts
UpdateContext({Bookinglist:Filter(
            'Booking Calendars',
            
            (
            StartDataCardValue.SelectedDate>=StartDate
            And
            StartDataCardValue.SelectedDate<=EndDate
            )
            Or
            (
            EndDataCardValue.SelectedDate>=StartDate
            And
            EndDataCardValue.SelectedDate<=EndDate
            )
            
           
        )});

//get the selected networks inside the Network combobox inside the Booking Calendar form
UpdateContext({relatedNetworksFortheBookingCalendar:bookingcaledarNetworksComboBox.SelectedItems})

 

 

but not sure how i can complete the business logic for checking the conflict in the booking calendars' networks in a delegable way?

 

Thanks

0 Replies