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 / See if record exist be...
Power Apps
Unanswered

See if record exist before patching.

(0) ShareShare
ReportReport
Posted on by 63

I have a Powerapp that allows user to order parts. I am looking to add some error checking to prevent over ordering. What I am looking for is if "DeliverTo"  and "Title" match a record that was created in the last 24 hours to notify the user that "Requestor" has already ordered "Title", "QTY" are you sure you want to order anyways? I am using SP List for my data source. My gallery is named "BrowseGallery1". So in short if this location has ordered Part # ***** in the past 24 hours it will alert the user.(if a matching record exist)

jmcbee_0-1694198527335.png

 

Categories:
I have the same question (0)
  • jmcbee Profile Picture
    63 on at

    I have this which has the regular notify. What I want is to set a variable to true if it exist. Which covers the screen to prevent edits and if the user selects "Yes" it sets variable to false and patches the fields. I also havent figured out the 24 hour part yet.

     

     

     

    If(
     IsBlank(DataCardValue17.Text) && IsBlank(DataCardValue18.Text) || IsBlank(DataCardValue8_1.Text) || IsBlank(DataCardValue10_1.Text), 
     Notify("Please fill in at least Part #, QTY, WO, or 700#.", NotificationType.Error),
     If(
     !IsBlank(LookUp(Filter(BrowseGallery1.AllItems, 
     Title = DataCardValue8_1.Text &&
     QTY = Value(DataCardValue10_1.Text) &&
     DeliverTo = DataCardValue16_1.Text &&
     Created >= DateAdd(Now(), -1, Hours) 
     )
     )),
     Notify("The record already exists."),
     Patch(
     'Material Handling', 
     Defaults('Material Handling'), 
     {
     Title: DataCardValue8_1.Text,
     QTY: Value(DataCardValue10_1.Text),
     '700#': DataCardValue17.Text,
     '711#': DataCardValue19.Text,
     WO: DataCardValue18.Text,
     'Deliver To?': DataCardValue11_1.Selected, 
     Requestor: DataCardValue12_1.Text,
     Reason: DataCardValue13_1.Selected, 
     Comments: DataCardValue14_1.Text,
     DeliverTo: DataCardValue16_1.Text
     }
     );
     Reset(DataCardValue8_1);
     Reset(DataCardValue10_1);
     Reset(DataCardValue13_1);
     Reset(DataCardValue14_1);
     Notify("Your order has been submitted successfully")
     )
    )

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard