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

People Picker returns previously added person

Hi all, I am pretty new to powerapps and I need your help with the following issue:I build an app in powerapps that allows a person to assign tasks to other people (they will receive an email notification that a new action has been assigned to them). The issue is that, for eg: 1. I create a new form for assigning a new task to a specific person and then save and submit the form. 2. When I open a new form or even an old one for editing, the name of that specific person (from 1) is prepopulated in the people picker box. Basically, what I would need is that when I create a new task the people picker box to be empty (and not prepopulated with the previous person used), or when i am editing an existing form, the people picker form to be populated with the person that have that task assigned.Thanks a lot!!
4 REPLIES 4
RandyHayes
Super User III
Super User III

@Amelie 

What is your DefaultSelectedItems property of your Combobox control?  If this is in a form, it should be based on the Parent.Default of the datacard.

Check that property and see if it is not set properly.

 

I hope this is helpful for you.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes
HenryARPhillips
Continued Contributor
Continued Contributor

Hi, so if the Form Mode is New it should reset and be blank. However there is also a Reset function that you can pass the name of a control. It will then reset to the default value of the control.

In terms of editing, you need to ensure that the item of the form is the item whose values you want to be populated in the Form.

Hopefully the following shows some helpful concepts:

HenryARPhillips_0-1614118250305.png

So above on the left we have a gallery looking to the same SP List that the Form on the right is hooked up to. The submit button is literally just doing SubmitForm(FormName). Now that in itself and with the Form set to a default mode of New, once submitted it will revert back to a blank empty form to be filled out.

HenryARPhillips_1-1614118348345.png

 

Notice default mode on the right.

I make an entry and click submit, first screen shot. Second shows the state of the form afterwards.

HenryARPhillips_2-1614118394477.png

 

So here this has actually done what you have stated and this is because the form has not been reset and is still in edit mode

 

HenryARPhillips_3-1614118449194.png

 

So one thing I could do here is have some logic such as in the new button

HenryARPhillips_4-1614118480430.png

 

 

Pressing new takes me to a state of 

HenryARPhillips_5-1614118497260.png

 

Now if we go back and Submit again, except this time we will change the submit button logic to:

 

HenryARPhillips_6-1614118568798.png

Now for the same example, new entry is made and submit is hit

HenryARPhillips_7-1614118602988.png

 

 

HenryARPhillips_8-1614118612295.png

 

The above is now blank as we ensured we set the Form to new. So your first issue is probably because the Form is still in edit mode. Now in terms of editing the right item, in my example I am using a gallery and when I click to go into the item, it is going to enter the form in edit mode and set a variable that is populated in the item property of the form.

 

HenryARPhillips_9-1614118695807.png

 

HenryARPhillips_10-1614118709107.png

 

HenryARPhillips_11-1614118718621.png

 

 

Now there are many ways to achieve the above, one quick way of seeing how you do this is to create a Power App from a SharePoint List. But hopefully this lays down the following key concepts that will help:

 

FormMode

 

Setting the Item that exists in the data source of the Form whilst in Edit Mode.

 

Also look to things like LastSubmit, if you want a quick reference to what was Last Submitted.




Hi! Thank you for your reply. 

I see that I am not using a form. The screen contains multiple dropdowns list where I can select or add the info required (for eg: a dropdown where I can select the name from Office365, a dropdown for category and so on). Now, if I select one dropdown: DefaultSelectedItems Property is empty, DisplayMode is DisplayMode.Edit and Visible: If(varmode="New"||varmode="Edit", true). 

I've tried to add to DefaultSelectedItems = Parent.Default, but I receive the following message: "Name isn't valid. The identifier isn't recognized.".

 

I'm still trying to understand how powerapps works, so sorry if I am not that clear. Thanks!

RandyHayes
Super User III
Super User III

@Amelie 

So if this is Not in a Form, then you will need to provide the appropriate formula for the DefaultSelectedItems property.  You have none right now...that will never select anything.

Parent.Default is only relevant to forms.

How are you getting a record for the screen that has the information??  Is this screen being reached by selecting a Gallery item?  Is this integrated into SharePoint (customize forms), or is a standalone 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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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 (35,598)