cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TicaAppBuilder
Helper I
Helper I

Saving default manager back to SharePoint list is not working

Hello awesome people! I'm trying to apply a Global Variable:

Set(VarUser, Office365Users.MyProfileV2());
Set(VarManager,Office365Users.ManagerV2(VarUser.userPrincipalName))

 

To my form called FormEdit with DefaultSelectedItems set to the following for that field where I'm trying to retrieve the Manager name of the user logged in. So when I click on creating a new form, the manager does populate correctly, but then when I submit the form (using a check mark icon with SubmitForm(FormEdit). 

 

If(FormEdit.Mode = FormMode.New,
Filter(
Table(
{
'@aodata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName: VarManager.displayName,
Claims: "i:0#.f|membership|" & VarManager.mail
}),
Not(IsBlank(DisplayName))),
Parent.Default)

 

Why is the Manager name not saving to the SharePoint list? Once SubmitForm executes, it just sets itself back to blank (nothing selected). But the rest of

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @TicaAppBuilder ,

Do you want to use current user's manager to update person field in your sharepoint list?

Could you tell me whether your person field allows multiple value?

I've made a similar test but not met the same problem like your description.

You could refer this:

set the app's OnStart:

Set(VarUser,Microsoft365Users.MyProfileV2());
Set(VarManager,Microsoft365Users.ManagerV2(VarUser.userPrincipalName))

//please notice that this connector has renamed to Microsoft365Users, not Office365Users any more.
1)if your person field not allows multiple value:

set the combo box's DefaultSelectedItems:

If(Form1.Mode = FormMode.New,
Filter(
Table(
{
'@aodata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName: VarManager.displayName,
Claims: "i:0#.f|membership|" & VarManager.mail
}),Not(IsBlank(DisplayName))),Table(Parent.Default))

2)if your person field  allows multiple value:

set the combo box's DefaultSelectedItems:

If(Form1.Mode = FormMode.New,
Filter(
Table(
{
'@aodata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName: VarManager.displayName,
Claims: "i:0#.f|membership|" & VarManager.mail
}),Not(IsBlank(DisplayName))),Parent.Default)

 

My person fields both have been updated successfully.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yutliu-msft
Community Support
Community Support

Hi @TicaAppBuilder ,

Do you want to use current user's manager to update person field in your sharepoint list?

Could you tell me whether your person field allows multiple value?

I've made a similar test but not met the same problem like your description.

You could refer this:

set the app's OnStart:

Set(VarUser,Microsoft365Users.MyProfileV2());
Set(VarManager,Microsoft365Users.ManagerV2(VarUser.userPrincipalName))

//please notice that this connector has renamed to Microsoft365Users, not Office365Users any more.
1)if your person field not allows multiple value:

set the combo box's DefaultSelectedItems:

If(Form1.Mode = FormMode.New,
Filter(
Table(
{
'@aodata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName: VarManager.displayName,
Claims: "i:0#.f|membership|" & VarManager.mail
}),Not(IsBlank(DisplayName))),Table(Parent.Default))

2)if your person field  allows multiple value:

set the combo box's DefaultSelectedItems:

If(Form1.Mode = FormMode.New,
Filter(
Table(
{
'@aodata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName: VarManager.displayName,
Claims: "i:0#.f|membership|" & VarManager.mail
}),Not(IsBlank(DisplayName))),Parent.Default)

 

My person fields both have been updated successfully.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you for the reply. I followed your instructions and connected to the new Microsoft 365 Users, and was able to pull user and manager successfully into a test label. However, the field that I'm trying to populate is still not filling with the Manager name. Is there another setting I'm missing on that field? Before it was defaulting but not saving, now it's not even defaulting.

 

Any suggestions?

 

Please disregard the last note. I saved, closed, reopened and tried again, and it worked, so must have some cached info somewhere.

Thank you so much!!!!! I really appreciate your help, you're awesome!!!!

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,591)