cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yoursnani
Post Patron
Post Patron

SharePoint people picker with power apps bug ?

Hi

I am building a app that hold people picker . everything working fine . but I am creating a variable for some reason . when forms open that time variable working fine as field is blank . if I add person in people picker and removed again . it's not creating as black field .

 

Any idea about this ???

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Yoursnani 

Yes,

CHOICE 1 - Display a warning label if empty

So then you can do this on the label visible property:

IsBlank(DatacardValue18.Selected.DisplayName)

This will show the label with the warning that a person needs to be selected.

 

CHOICE 2 - Restrict submit

I would recommend then, for your SubmitButton, to set the DisplayMode to:

If(IsBlank(DatacardValue18.Selected.DisplayName), Disabled, Edit)

 

This will prevent the user from submitting the form if the value is missing.  Always better from a UI perspective to not have the user try an action and get a failure.

This would be in addition to CHOICE 1 above.

 

CHOICE 3 - give one shot before displaying warning label.

If you only want to do this when they try to submit, then you would do the following Formula on the OnSelect action of the submit button:

If(IsBlank(DatacardValue18.Selected.DisplayName), 
    Set(varInvalid, true),

    SubmitForm(yourForm)
)

Then set the Visible property of the label to; varInvalid

 

You'll also want to make sure you add for this scenario, the following formula to the OnSuccess action of your form:

Set(varInvalid, false)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

9 REPLIES 9
RandyHayes
Super User
Super User

@Yoursnani 

Can you provide more details on the problem you are having and any formulas that you suspect are an issue.

There is no bug, so the issue is with your app.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

I have simple app 

 

One is title column and another one is assignto column (DataCardValue18 is card name) its a person column .

 

I have one button 

Onselect-  if(!IsBlankorError(DatacardValue18.SelectedItems),Set(Var,true),Set(Var,false))

 

Also I have added one label

 

Label Text property - Var 

 

What happening here is datacard is blank or filled . value of variable not changing . when I click button 

 

I not understanding what I am missed 

 

RandyHayes
Super User
Super User

@Yoursnani 

I'm not really following the descriptions you have.

I am assuming your Assigned To column is in a Combobox (DataCardValue18)

But can you explain the button and its purpose?  And also what the label is, and its purpose?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

I just want want to create a variable for data card value18 is  error or blank variable should set true . if not errors or blank in datacardvalue18  . variable is false

How can you do for people picker ?

RandyHayes
Super User
Super User

@Yoursnani 

Yes, but you are setting the variable to true or false and yet that is what you are displaying in a label - true or false...is there a purpose for that?

 

The use of IsErrorOrBlank is not relevant to the scenario as what you refer to as a People Picker is just a combobox.  So you really only need this anyway for that variable:  Set(Var, !IsBlank(DatacardValue18.Selected.DisplayName))

 

But, there is a specific reason why I ask about the purpose of this and I will also add the question...where is the button that you have located, in the form or outside of the form?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

my exactly scenario is .

 

When some one  submit the form. I want to show a label if that people picker empty or error 

 For that I want to create a variable true or false and when true . label will be visible . when false label will be hide . 

 

So I can warn them with label .

 

 

 Can you please give me exact code for this scenario .

 

Thank you

RandyHayes
Super User
Super User

@Yoursnani 

Yes,

CHOICE 1 - Display a warning label if empty

So then you can do this on the label visible property:

IsBlank(DatacardValue18.Selected.DisplayName)

This will show the label with the warning that a person needs to be selected.

 

CHOICE 2 - Restrict submit

I would recommend then, for your SubmitButton, to set the DisplayMode to:

If(IsBlank(DatacardValue18.Selected.DisplayName), Disabled, Edit)

 

This will prevent the user from submitting the form if the value is missing.  Always better from a UI perspective to not have the user try an action and get a failure.

This would be in addition to CHOICE 1 above.

 

CHOICE 3 - give one shot before displaying warning label.

If you only want to do this when they try to submit, then you would do the following Formula on the OnSelect action of the submit button:

If(IsBlank(DatacardValue18.Selected.DisplayName), 
    Set(varInvalid, true),

    SubmitForm(yourForm)
)

Then set the Visible property of the label to; varInvalid

 

You'll also want to make sure you add for this scenario, the following formula to the OnSuccess action of your form:

Set(varInvalid, false)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Sorry Randy I choose 3 but . not working with me .

Could you check from your side it's working or not 

RandyHayes
Super User
Super User

@Yoursnani 

Nothing to check!  I know that formula work 100%!

 

But this is likely related to another issue.  So, what is the DefaultMode of your form and what is the Item property of the form??

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,112)