Hi, I'm building new PowerApps for events reservation, this should look up for 3 conditions before submitting the Event (Time/date Periods, Location, and multiple selection Classrooms) to check for time overlapping or (classroom/ location) Conflict.
- multiple selection Classrooms Combo Box converted into Text in order to use it inside lookup function to compare it with multiple selection SPO column, i used Left, Right, and Mid function for the comparison.
comparison is working when the list of selected classrooms is few, otherwise it doesn't work!
Please check the code below:-
ClearCollect(Data_Check_Lesson_AR1,
LookUp('Events Lists',
From in Filter( 'Events Lists',
( ( Start_Time <= From && End_Time >= To )
Or ( Start_Time >= From && End_Time <= To )
Or ( Start_Time < To && End_Time >= To )
)
&& Actv_Location.Value = New_Lesson_Loc_AR.Selected.Value
)
Or
( ( Start_Time <= From && End_Time >= To )
Or ( Start_Time >= From && End_Time <= To )
Or ( Start_Time < To && End_Time >= To )
)
&&
( Left(Label_Class_Less_AR.Text, Find(",",Label_Class_Less_AR.Text)-1) in Concat(Classes_New_EN, Value & ",") Or
Right(Label_Class_Less_AR.Text, Find(",",Label_Class_Less_AR.Text)) in Concat(Classes_New_EN, Value & ",")
Or Mid(Concat(Classes_New_EN, Value & ","), Find(",",Concat(Classes_New_EN,Value & " " ))) in Mid(Label_Class_Less_AR.Text,Find(",",Label_Class_Less_AR.Text))
Or Concat(Classes_New_EN, Value & ",") in Mid(Label_Class_Less_AR.Text,Find(",",Label_Class_Less_AR.Text)+
Len(Left(Label_Class_Less_AR.Text, Find(",",Label_Class_Less_AR.Text))))
)
).From
))
-----
Classes_New_EN is the multiple selection column in SPO
Start_Time & End Time is the combination of date and time
Label_Class_Less_AR.Text is the Concat(Classroom Combobox)
New_Lesson_Loc_AR.Selected.Value is the DropDown of Location.
Items of Table in the picture is Data_Check_Lesson_AR1