cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
elie_abidaher
Frequent Visitor

Prevent duplicates in an entity

Hi everyone

 

I have 3 entities in my recruitment Power Apps Portal
Applicants
Positions
Applications

how can i restrict and applicant by not allowing him to apply for the same Position more than once?

Maybe it is a simple thing, but I am new to Portals  🙂

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisPiasecki
Super User
Super User

Hi @elie_abidaher ,

You could use an alternate key to enforce uniqueness. You can do so by doing the following steps in the Power Apps maker portal:

 

  1. On your Application entity, add lookup fields for Applicant and Position.
  2. If the above lookups already exist, then you must cleanup any existing duplicate Application records that have the same Applicant and Position.
  3. On your Application entity, select the Keys tab, then Add a new key. Select the Applicant and Position fields from the list.
    Cpiasecki_1-1605118585103.png
  4. Save, then publish all customizations. This will kick-off a background job to index your Application entity records. Depending how many application records you have, this may take several minutes.
  5. To confirm the indexing job is complete, you will need to Switch to classic solution explorer. Navigate to your Application Entity then select Keys. If you see an Active status, then you are good to go.
    Cpiasecki_0-1605118501628.png
  6. To test this, try creating an Application record where an Applicant and Position combination already exists. You should get an error when trying to save the record. (In the Power Apps Portal the error message may look different, but the same behavior should be enforced by CDS regardless of which type of App.
    Cpiasecki_2-1605118685188.png

     

Hope this helps.

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

2 REPLIES 2
ChrisPiasecki
Super User
Super User

Hi @elie_abidaher ,

You could use an alternate key to enforce uniqueness. You can do so by doing the following steps in the Power Apps maker portal:

 

  1. On your Application entity, add lookup fields for Applicant and Position.
  2. If the above lookups already exist, then you must cleanup any existing duplicate Application records that have the same Applicant and Position.
  3. On your Application entity, select the Keys tab, then Add a new key. Select the Applicant and Position fields from the list.
    Cpiasecki_1-1605118585103.png
  4. Save, then publish all customizations. This will kick-off a background job to index your Application entity records. Depending how many application records you have, this may take several minutes.
  5. To confirm the indexing job is complete, you will need to Switch to classic solution explorer. Navigate to your Application Entity then select Keys. If you see an Active status, then you are good to go.
    Cpiasecki_0-1605118501628.png
  6. To test this, try creating an Application record where an Applicant and Position combination already exists. You should get an error when trying to save the record. (In the Power Apps Portal the error message may look different, but the same behavior should be enforced by CDS regardless of which type of App.
    Cpiasecki_2-1605118685188.png

     

Hope this helps.

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

Hi @ChrisPiasecki 

Thank you very much, it worked

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,943)