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

PowerApps People picker check as null on submit

Hi, 

 

I am having SharePoint list and there are people picker column. I have created those people picker column as choice column at PowerApps form like Choices([@Datasource].column). Now  I need to check if those value are null on submit, it should not save and when all the value are there its should display success message. if people picker value is not there then it should not display success msg on display. 

6 REPLIES 6
zmansuri
Super User
Super User

Make "Required" property of that people picker data card:

true

On OnSuccess of form or if you are using patch code. Then after the patch you can write

Notify("Success Message",NotificationType.Success)

noel654
Frequent Visitor

hi @zmansuri I am looking for solution for something like below.

 

If(
(Not(DataCardValue9.Text = "") && Not(DataCardValue16.Text = "") && Not(DataCardValue23.Text = "") && Not(datacardpeoplepicker1.selected.tex ="") && Not(datacardpeoplepicker2.selected.tex ="")),
Notify(
"Thank you.",
NotificationType.Success
)
);
SubmitForm(SharePointForm1)

If(
Not(DataCardValue9.Text = "") && Not(DataCardValue16.Text = "") && Not(DataCardValue23.Text = "") && IsEmpty(datacardpeoplepicker1.SelectedItems) && IsEmpty(datacardpeoplepicker2.SelectedItems),
Notify(
"Thank you.",
NotificationType.Success
)
);

SubmitForm(SharePointForm1);

noel654
Frequent Visitor

@zmansuri  I tried above isempty formula but it is not working. I tried with not and IsEmpty both with selecteditem.

kulkarni_anuj
Frequent Visitor

@noel654  Try using the isblank in this way and check

If(
(Not(DataCardValue9.Text = "") && Not(DataCardValue16.Text = "") && Not(DataCardValue23.Text = "") && !IsBlank(datacardpeoplepicker1.selected.value ="") && !IsBlank(datacardpeoplepicker2.selected.value ="")),
Notify(
"Thank you.",
NotificationType.Success
)
);
SubmitForm(SharePointForm1)

rampprakash
Super User
Super User

Hi @noel654,

 

I tried the same with below code

 

If(IsBlank(DataCardValue),Notify("Error"),SubmitForm(Form1));

 

i can see its working. 

 

If you are using forms then you can Turn On Mandatory so that OOB Behaviour will prevent saving without any condition

 

rampprakash_0-1631598775452.png

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,186)