cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Helper IV
Helper IV

Check Employee id exists in the SharePoint list

Dear All,

 

I have a custom screen made with user input controls for onboarding employee. When the user click on "Save" button, i need to check the Employee ID mentioned is already exists in the list.

If record exists i want to show a message, record already exists, if not go ahead and save the record in the share point list.

 

But i am not getting the desired output from the command i try. 

Set(EmpRecord,LookUp(Employee_Onboarding,'Employee ID' = 'Employee ID',ID))

 

On button click

If (isBlank() Emprecord, 

Patch{},

Notify "The Employee record already exists in the system")

 

Please help

1 ACCEPTED SOLUTION

Accepted Solutions
Jacky_Shen
Resolver IV
Resolver IV

Hi @venka91 ,

 

I think you can write the code in your "Save" button using "If", such as:

If(CountIf(Employee_Onboarding,"Employee ID"=DataCard.Text)>0,Notify,Patch...)

Hope this helps.

View solution in original post

3 REPLIES 3
Jacky_Shen
Resolver IV
Resolver IV

Hi @venka91 ,

 

I think you can write the code in your "Save" button using "If", such as:

If(CountIf(Employee_Onboarding,"Employee ID"=DataCard.Text)>0,Notify,Patch...)

Hope this helps.

View solution in original post

venka91
Helper IV
Helper IV

I am bit confused. Does this check for duplicate of employee id ?

If the employee id what user is entering, Submit action should not save the data.

Hi @venka91 ,

 

It should. Another solution is: go to your SharePoint list setting, and make the field "Reinforce Unique Value", then you don't need to code the save button.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (30,017)