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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / CDS : Check for record...
Power Apps
Unanswered

CDS : Check for record exist for lookup fields

(0) ShareShare
ReportReport
Posted on by 12

I have a one entity which is Customer having customer Id as field, this Customer  Id is part of Customer Attribute having 1 : N relationship. 

Now I need to LookUp in the table whether the record with this Customer  Id exist or not. How can I achieve this.

 

Thanks in Advanced

I have the same question (0)
  • GerbenB Profile Picture
    13 on at

    Hi there, please try this snippit

     

     

    IsBlankOrError(LookUp(Customers, 'Customer Id'= "1001").Name)

     

     

     

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @anubhav29 ,

    Firstly, let me explain your issue:

    1)entity1 named Customer: CustomerId(number type)

    2)entity2 named CustomerAttribute: CustomerId(lookup type)

    3)entity1 and entity2 has relationship of 1:N

    4)you select one item of entity1, you want to check whether records in entity2 has related CustomerId

    Am I right? If I have any mistake, please correct me.

    If my assumption is right. Try this:

    1)drop down1 for entity1, set drop down1's Items:

    Customer

    2)insert a label to represent whether there's record in entity has selected CustomerId value. True is yes, false is no.

    set the label's Text:

    If(
    !IsEmpty(Filter(CustomerAttribute,drop down1.Selected.Name in CustomerId.Name)),
    true,false
    )

     

     

     

    Best regards,

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @anubhav29, Are you using model-driven app or canvas app? Thanks 

  • Verified answer
    Ryan S Newcomb Profile Picture
    236 on at

    You could setup a custom alternate key on the CDS entity. This should prevent duplicates from being created on the server.  On a model-driven app, the user would be presented with a somewhat jarring message alert letting them know.  On canvas, I’m not sure how that would be presented (probably as a runtime error...).

     

    One thing I’ve done is setup a check in canvas apps.  I use a label hidden, and set the visibility property to a Boolean expression that is basically looking in CDS to see if a record exists that matches what the user entered in the form in the app. If there is a match, the Boolean is true and so the label’s visibility property will be set to True and the label will display to the user.  I’ve also set the submit button display mode property to be disabled if that label is showing.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 774 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 335 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 248

Last 30 days Overall leaderboard