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 / Validation on sharepoi...
Power Apps
Answered

Validation on sharepoint people field

(0) ShareShare
ReportReport
Posted on by 909

Hello,

 

I have a form which is a sharepoint combo box.

It allows to pick people.

Items: Choices([@ListaAdmin].Dane_x0020_administratora)

 

It works good - I can pick people from my AD.

But I want to use this form together with a button that submit it.

It works in a basic mode.

 

 

SubmitForm(Form6);ResetForm(Form6);Notify("Admin added!",NotificationType.Success)

 

but it allows people to submit admin name more than once. It causes duplicates.

 

So I thought that I can use such a function:

 

If(
 !IsBlank(LookUp('ListaAdmin', Choices([@ListaAdmin].Dane_x0020_administratora).DisplayName),
 Notify("This user is already admin", NotificationType.Error),
 SubmitForm(Form6);ResetForm(Form6)
))

 

I want this to check through ListaAdmin (sharepoint list) whether user is already added. If yes - stop the action with error.

Perfectly it would also show message onSuccess...

 

But this shows errors:

Invalid argument table, expected a boolean, Invalid number of arguments received 3 , expected 1, invalid number of arguments expected 2 or more and received 1, lookup function got invalid arguments.

 

Thanks for help and tips.

 

Edit.

I also tried this:

If(
 !IsBlank(LookUp('ListaAdmin',Choices([@ListaAdmin].Dane_x0020_administratora) in DataCardValue5.SelectedItems.Value),
 Notify("This user is already admin", NotificationType.Error),
 SubmitForm(Form6);ResetForm(Form6)
))

but still no results...

 

Categories:
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Elitezone ,

    You can try like below - 

    Hope maybe work for you this time....🙃
    If(
    !IsBlank(LookUp('ListaAdmin',Dane_x0020_administratora.DisplayName in DataCardValue5.SelectedItems.Value),
    Notify("This user is already admin", NotificationType.Error),
    SubmitForm(Form6);ResetForm(Form6)
    ));

    Note - if you Dane_x0020_administratora FIle is People type. 
    Thanks

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Elitezone ,

     

    Do you want to validate if the selected user has already in your Sharepoint admins list?

     

    If you do, your formula should be modified into:

     

    If(
     !IsBlank(LookUp('ListaAdmin', DataCardValue5.Selected.Email in Dane_x0020_administratora.Email)),
     Notify("This user is already admin", NotificationType.Error),
     SubmitForm(Form6);ResetForm(Form6)
    ))

     

    Please have try and hope it helps.

     

    Best regards,

    Jeffer Ni

  • Elitezone Profile Picture
    909 on at

    @v-jefferni @VijayTailor 

    Thanks.

    I implemented it in my formula and it works.

    If(
     !IsBlank(LookUp('ListaAdmin', DataCardValue5.Selected.Email in Dane_x0020_administratora.Email)),
     Notify("Ta osoba ma już uprawnienia", NotificationType.Error),
     If(varAdmin && varAdmin1,SubmitForm(Form6);ResetForm(Form6);Notify("Administrator został dodany!",NotificationType.Success),Notify("Brak uprawnień")
    ))

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard