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

Pre populate single persons name

I would like pre-poulate general managers name in the field 'Werkleiter' which will never change. How can i do that?

 

rishimarde_1-1643898486497.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @rishimarde 

 

Set the App Onstart of the property to

Set(Userinfo,User());
Set(
    UserManager,
    With(
        {Manager: Office365Users.ManagerV2(Lower(Userinfo.Email))},
        {
            Claims: "i:0#.f|membership|" & Manager.mail,
            Department: "",
            DisplayName: Manager.displayName,
            Email: Manager.mail,
            JobTitle: "",
            Picture: ""
        }
    )
)

 

Set the DefaultSelectedItems Property of the Combo box to

UserManager

 

Or (Set manager only when the form is New otherwise existing data)

 

If(EditForm1.Mode = FormMode.New, UserManager, Parent.Default)

 

Reference

StalinPonnusamy_0-1644239132804.png


Thanks,
Stalin - Learn To Illuminate

View solution in original post

4 REPLIES 4
StalinPonnusamy
Super User
Super User

Hi @rishimarde 

 

Create a collection at the start of the app and set the Items property of the dropdown or combo box.

ClearCollect(AllManagers, {Name: "Sam"}, {Name: "Dan"})

 

Set items property of the dropdown or combo

StalinPonnusamy_0-1643899525361.png

 

Reference

StalinPonnusamy_1-1643899542532.png


Thanks,
Stalin - Learn To Illuminate

Nogueira1306
Super User
Super User

On App On Start write this:

Collect(CollectionManager; {
Manager: {
DisplayName: UtilizadoresdoOffice365.UserProfile(MANAGER EMAIL).DisplayName;
Claims: "i:0#.f|membership|" & Lower(MANAGER EMAIL);
UserPrincipalName: UtilizadoresdoOffice365.UserProfile(MANAGER EMAIL).UserPrincipalName
}
}

)

 

Nogueira1306_0-1643899494444.png

 

Write this on Default Selected Itens:

 

Nogueira1306_1-1643899596070.png

 

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

Hi

 

I tried this but still getting some error, I don't know what I am doing wrong. 

could you please help me with that?

 

Many Thanks!!

StalinPonnusamy
Super User
Super User

Hi @rishimarde 

 

Set the App Onstart of the property to

Set(Userinfo,User());
Set(
    UserManager,
    With(
        {Manager: Office365Users.ManagerV2(Lower(Userinfo.Email))},
        {
            Claims: "i:0#.f|membership|" & Manager.mail,
            Department: "",
            DisplayName: Manager.displayName,
            Email: Manager.mail,
            JobTitle: "",
            Picture: ""
        }
    )
)

 

Set the DefaultSelectedItems Property of the Combo box to

UserManager

 

Or (Set manager only when the form is New otherwise existing data)

 

If(EditForm1.Mode = FormMode.New, UserManager, Parent.Default)

 

Reference

StalinPonnusamy_0-1644239132804.png


Thanks,
Stalin - Learn To Illuminate

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,992)