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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check if SharePoint li...
Power Apps
Unanswered

Check if SharePoint list item exists based on Collection values - Error Handling

(0) ShareShare
ReportReport
Posted on by 4

Hi everyone,

I am working on a shopping cart system to book ressources in a room. There is an issue, that people are able to book the same ressource twice, if they both have the "available Ressource" screen open and choose the same ressource for a lapping time frame at the same time. This occurs, because the gallery data does not refresh every second or so, only when people change the screen, or trigger an event. I think this would'nt be good for permformance reason also and if i refresh the screen, the check box of the selected ressources also resets.

 

So the idea was, when adding the ressources to the shopping cart, the app checks within the SharePoint list, if an item already exists with the same date (or time frame) and Desk name. If yes, please send an error message, else create a new item in the list. This is my current code, but it only works, if I check the exact dates and not the critical time frame, meaning "DeskText = Desk.Title && 'Check Out From' = startTime && CheckOutTo = endTime" works, but not the entire formula:

 

ForAll(selectedDesks As Desk, If(!IsBlank(LookUp('Desk Reservations', DeskText = Desk.Title && 'Check Out From' >= startTime && CheckOutTo <= endTime || 'Check Out From' <= endTime && CheckOutTo >= endTime)),

Notify("Ressource not available any more, please check your shopping cart")));


ForAll(selectedDesks As Desk, If(IsBlank(LookUp('Desk Reservations', DeskText = Desk.Title && 'Check Out From' >= startTime && CheckOutTo <= endTime || 'Check Out From' <= endTime && CheckOutTo >= endTime)),

Patch('Desk Reservations',
Defaults('Desk Reservations'),
{
Title: currentUser.FullName & " " & Desk.Title,
DeskText: Desk.Title,
CheckOutFrom: startTime,
CheckOutTo: endTime,
DeskGroup: Text(Desk.Tischgruppe),
Comment: CommentInput.Text,
Shopping_Cart: "Yes",

ReservedBy: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & currentUser.Email,
Department: "",
DisplayName: currentUser.FullName,
Email: currentUser.Email,
JobTitle: "",
Picture: ""
}

})));

 

Could you please help, because this is a critical business case.

 

Thank you!

 

Categories:

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard