cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimmyWork
Memorable Member
Memorable Member

People column (Edit Form) Not showing any selected user

So I have a People column in a form. Everything works, if I edit the item it shows me the user added to in people column and I can search and re-select another user and save.

 

But when I then want to limit the people that you actually can select from I use the following.

Item = Office365Groups.ListGroupMembers("Some Group ID here").value

 

Now I can only select from users that are in the group I specified, but saving the form results it no change even if I change the people I select. Also when I open a item in edit form, it no longer displays the user from in the people column even if I can see it's there in the SharePoint list

2 ACCEPTED SOLUTIONS

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @JimmyWork 

 

This is not straightforward.  Took a long time to find out the answer. Here you go

Set the Items property of Combo box to

 

Office365Groups.ListGroupMembers("Group GUID").value

 

 

Set the DefaultSelecteditems property to the Person combo box to

Office365Users.UserProfileV2(ThisItem.'PersonColumnName'.Email)

 

Set the Update Property of Person Datacard to

{
    Claims: "i:0#.f|membership|" & Lower(PersonCombobox.Selected.mail),
    Department: "",
    DisplayName: Lower(PersonCombobox.Selected.displayName),
    Email: Lower(PersonCombobox.Selected.mail),
    JobTitle: "",
    Picture: ""
}

 

My Example

StalinPonnusamy_0-1634677261800.png

 

StalinPonnusamy_1-1634677281451.png

StalinPonnusamy_2-1634677297903.png

 

View solution in original post

StalinPonnusamy
Super User
Super User

Hi @JimmyWork 

 

You are right. We need to validate blank as well. Here is the solution

 

Set the DefaultSelectedItems property to

If(
    !IsBlank(ThisItem.AssignedTo.Email),
    Office365Users.UserProfileV2(ThisItem.AssignedTo.Email),
    Blank()
)

 

Set the Update property of the Card to

If(
    !IsBlank(DataCardValue12.Selected.mail),
    {
        Claims: "i:0#.f|membership|" & Lower(DataCardValue12.Selected.mail),
        Department: "",
        DisplayName: Lower(DataCardValue12.Selected.displayName),
        Email: Lower(DataCardValue12.Selected.mail),
        JobTitle: "",
        Picture: ""
    },
    Blank()
)

 

Important: To set a Blank value for the person field, we need to enable some settings

  • Go to Settings
  • Select "Upcoming features"
  • Click the "Experimental" tab
  • Enable "Formula-level error management"

StalinPonnusamy_0-1634734721279.png

 


Thanks,
Stalin - Learn To Illuminate

View solution in original post

9 REPLIES 9
StalinPonnusamy
Super User
Super User

Hi @JimmyWork 

 

I assume you are using the form to edit the data. So

Set the DefaultSelectedItems property to person Combobox to

Parent.Default

StalinPonnusamy_0-1634528227052.png

 

and Set Update property of the Data card (Not Control) to 

ComboBoxName.Selected

StalinPonnusamy_1-1634528248868.png

 

v-qiaqi-msft
Community Support
Community Support

Hi @JimmyWork,

Do you want to save the combo box selected user to Person column and display the user when you edit the record?

Could you please share a bit more about the scenario?

 

Actually, the Update property of the data card corresponding to the Combo Box depends on how you set the Items property of the Combo Box. Since you have changed your Items property using the Office365Groups() function, I think you should do some modification on the Update property of the data card and the DefaultSelectedItems of the Combo Box.

 

I agree with @StalinPonnusamy that set the Update property as Combo Box selected to represent the expected record value. However, please try to modify your DefaultSelectedItems as below:

ThisItem.PersonColumnName.

 

Hope it could help you at some degree.

Best Regards,
Qi

@StalinPonnusamy @v-qiaqi-msft 

Thank you for answering.

This is my current setting in the Combo Box, default values not touched.

Yes I would like to save the combo box selected user to Person column and display the user when you edit the record.

 

Default = ThisItem.ColumnName

Update = DataCardValue12.Selected

DefaultSelectedItems = Parent.Default

 

This is not working, when I open a item in edit mode then nothing is displayed in the ComboBox even if the item has valid data. If I make a change and submit the form, no update happens.

 

Same if I set the DefaultSelectItems = ThisItem.ColumnName

 

I have tried everything here, no matter what I select it just wont show the the current data or save what I change in that field. By default everything works but as soon as I change the Items to the Office365 group values it stops working

 

Found this: https://powerusers.microsoft.com/t5/Building-Power-Apps/Office365Users-selection-is-not-submitting-t...


Also found an old issue from myself: https://powerusers.microsoft.com/t5/Building-Power-Apps/Person-column-and-SubmitForm/td-p/549235

 

That might solve the actual submitting of the form but not displaying the data the form contains when edited. Not sure why ThisItem.ColumnName does work to display the data from the People Column in the item

StalinPonnusamy
Super User
Super User

Hi @JimmyWork 

 

This is not straightforward.  Took a long time to find out the answer. Here you go

Set the Items property of Combo box to

 

Office365Groups.ListGroupMembers("Group GUID").value

 

 

Set the DefaultSelecteditems property to the Person combo box to

Office365Users.UserProfileV2(ThisItem.'PersonColumnName'.Email)

 

Set the Update Property of Person Datacard to

{
    Claims: "i:0#.f|membership|" & Lower(PersonCombobox.Selected.mail),
    Department: "",
    DisplayName: Lower(PersonCombobox.Selected.displayName),
    Email: Lower(PersonCombobox.Selected.mail),
    JobTitle: "",
    Picture: ""
}

 

My Example

StalinPonnusamy_0-1634677261800.png

 

StalinPonnusamy_1-1634677281451.png

StalinPonnusamy_2-1634677297903.png

 

Hi @JimmyWork,

I agree with @StalinPonnusamy, that you should try a different schema as below:

{
    Claims: "i:0#.f|membership|" & xxx@123.Com,
    Department: "",
    DisplayName: xxx@123.Com,
    Email: xxx@123.Com,
    JobTitle: "",
    Picture: ""
}

Please try the solution from @StalinPonnusamy and check if this could solve your problem.

Best Regards,
Qi

@StalinPonnusamy Thank you so much, this solved it, will remember this solution now 🙂

And @v-qiaqi-msft thank you to for the help 🙂

@StalinPonnusamy Last question regarding this.
Everything works, but if the items people column is empty and i select edit then PowerApps throw the error, because the DefaultSelectedItem is empty, the end user does not see this at all so it's fine. But I guess I would need to do something like below, but is the below correct? It works but I'm not sure if it's the best practice to use Blank()

 

DefaultSelectedItem

If(ThisItem.AssignedTo.Email = Blank(), Blank(), Office365Users.UserProfileV2(ThisItem.AssignedTo.Email))

 

And update would be:

If(ThisItem.AssignedTo.Email = Blank(), Blank(),

{
    Claims: "i:0#.f|membership|" & Lower(DataCardValue12.Selected.mail),
    Department: "",
    DisplayName: Lower(DataCardValue12.Selected.displayName),
    Email: Lower(DataCardValue12.Selected.mail),
    JobTitle: "",
    Picture: ""
})

 

StalinPonnusamy
Super User
Super User

Hi @JimmyWork 

 

You are right. We need to validate blank as well. Here is the solution

 

Set the DefaultSelectedItems property to

If(
    !IsBlank(ThisItem.AssignedTo.Email),
    Office365Users.UserProfileV2(ThisItem.AssignedTo.Email),
    Blank()
)

 

Set the Update property of the Card to

If(
    !IsBlank(DataCardValue12.Selected.mail),
    {
        Claims: "i:0#.f|membership|" & Lower(DataCardValue12.Selected.mail),
        Department: "",
        DisplayName: Lower(DataCardValue12.Selected.displayName),
        Email: Lower(DataCardValue12.Selected.mail),
        JobTitle: "",
        Picture: ""
    },
    Blank()
)

 

Important: To set a Blank value for the person field, we need to enable some settings

  • Go to Settings
  • Select "Upcoming features"
  • Click the "Experimental" tab
  • Enable "Formula-level error management"

StalinPonnusamy_0-1634734721279.png

 


Thanks,
Stalin - Learn To Illuminate

@StalinPonnusamy Thank you but I did not have to activate Forumla-level error management, it worked anyway 🙂

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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
Users online (1,409)