Good day
I have an "Event booking app" and need to check 2 fields when submitting to the SharePoint list - i.e. the Date field and the Time field. One should not be able to submit if those 2 fields have identical data in it.
Also, can you perhaps help me with the delegation warning on the gallery?
Sort(Filter(EventBookingSlots,Date=DatePicker1.SelectedDate), StartTime.Value,SortOrder.Ascending)
Thank you
Unfortunately I am still getting an error - the system does not seem to recognise "FilteredEvents"
please try the modified approach:
If(
CountRows(
Filter(
FilteredEvents,
StartTime = StartTimedd.SelectedText,
EndTime = EndTimedd.SelectedText
)
) > 0,
Notify("Event with the same Date, Start Time, and End Time already exists.", NotificationType.Error),
Patch(
EventBookingSlots,
Defaults(EventBookingSlots),
{
Date: DatePicker1.SelectedDate,
StartTime: StartTimedd.SelectedText,
EndTime: EndTimedd.SelectedText,
Title: DetailsTxt.Text,
EventName: EventnameLbl.Text,
Venue: VenueTxt.Text
}
)
)
On this part of your code, I am not too worried about the Delegation warning - but it complains about incompatible type for comparison. It also says "Countrows" is not supported by this connector
you can try to just put FilteredEvents in your items Property of your gallery
there only the items of the collection called FilteredEvents will show
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings
The gallery is called "galOverview".
this is no error, its a delegation warning.
you can set the delegation limit in the app settings to 2.000 entried (per default its 500).
if you are below the 500 or 2000 entries this should work without problems.
what is the gallery in your app called?
Thank you for the guidance, however I am getting this error:
Also, for the gallery - I need to sort the time in descending order for that specific day so I cannot use
Filter(EventBookingSlots, Date = DatePicker1.SelectedDate)
please try this instead:
If(
Value(StartTimedd.SelectedText.Value) > Value(EndTimedd.SelectedText.Value),
Notify("End Time cannot be less than Start Time", NotificationType.Error),
If(
CountRows(
Filter(
EventBookingSlots,
Date = DatePicker1.SelectedDate,
StartTime = StartTimedd.SelectedText,
EndTime = EndTimedd.SelectedText
)
) > 0,
Notify("Event with the same Date, Start Time, and End Time already exists.", NotificationType.Error),
Patch(
EventBookingSlots,
Defaults(EventBookingSlots),
{
Date: DatePicker1.SelectedDate,
StartTime: StartTimedd.SelectedText,
EndTime: EndTimedd.SelectedText,
Title: DetailsTxt.Text,
EventName: EventnameLbl.Text,
Venue: VenueTxt.Text
}
)
)
)
and this for ur other issue:
Filter(EventBookingSlots, Date = DatePicker1.SelectedDate)
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings
OnSelect of the Submit button:
If(Value(StartTimedd.SelectedText.Value)>Value(EndTimedd.SelectedText.Value),Notify("End Time cannot be less than Start Time",NotificationType.Error), Patch(EventBookingSlots, Defaults(EventBookingSlots),{Date: DatePicker1.SelectedDate, StartTime: StartTimedd.SelectedText, EndTime: EndTimedd.SelectedText, Title: DetailsTxt.Text, EventName: EventnameLbl.Text, Venue: VenueTxt.Text}))
On the gallery:
Sort(Filter(EventBookingSlots,Date=DatePicker1.SelectedDate), StartTime.Value,SortOrder.Ascending)
hey @janineb
can you please copy /paste the code from the screenshot so we do not need to retype?
thanks in advance
WarrenBelz
146,731
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,075
Most Valuable Professional