web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set default to current...
Power Apps
Unanswered

Set default to current user for people picker on power apps (Dataverse is underlying table)

(1) ShareShare
ReportReport
Posted on by 4

I am building an app built on Dataverse tables.  When navigating to a new form, I would like to set the default for a people picker field (entitled 'Associate') to the current user.  I have attempted to use the formula that works with SharePoint as a data source, but it does not work here, so I assume that there is different language used with Dataverse as a data source.

 

The function that I used is as follows (screen shot also attached):

If(Parent.Mode= FormMode.New,{
 Claims: Concatenate(
 "i:0#.f|membership|",
 User().Email // Person email
 ),
 Department: "",
 DisplayName: User().FullName,
 Email: User().Email, // Person email
 JobTitle: "",
 Picture: ""
},ThisItem.Associate

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hi @ChuckWells ,

     

    Here you go - 

    In my case, it is combobox, so on its 'DefaulSelectedItems' property, I've used this formula and it worked as expected 🙂

    If(
     Form1.Mode = FormMode.New,
     {
     Claims: "i:0#.f|membership|" & User().Email,
     DisplayName: User().FullName
     },
     Parent.Default
    )

    swaminawale_0-1679839036719.png

     

    Let me know if this helps and of it is, then accept this as a solution. 

    Thanks 😀

     

  • ChuckWells Profile Picture
    4 on at

    @Anonymous Thank you very much at your attempt to help!

    I attempted your code in both the DefaultSelectedItems property of the DataCardValue (attempt one) and the Default Property of the DataCard (attempt two).  Neither attempt worked.

     

    Attempt one: (DefaultSelectedItems property of the DataCardValue)

    if(
    frmTimeTracker.Mode = FormMode.New,
    {
    Claims: "i:0#.f|membership|" & User().Email,
    DisplayName: User().FullName
    },
    Parent.Default
    )

     

    Attempt two: (Default Property of the DataCard)

    if(
    frmTimeTracker.Mode = FormMode.New,
    {
    Claims: "i:0#.f|membership|" & User().Email,
    DisplayName: User().FullName
    },
    ThisItem.Associate
    )

  • Community Power Platform Member Profile Picture
    on at

    Hi @ChuckWells 

     

    1. What is the items property of that combobox/dropdown?

    2. Are you using office365 connector to display all users from Azure AD.

     

    Try to put Office365User.SearchUser() in items property and I guess it should work 🙂

    Let me know.

    Thanks 😀

  • RobBallantyne Profile Picture
    17 on at
    Did you ever figure out a solution to this issue? I'm losing my mind here. I'm about to just add a checkbox to have the option to edit user and then create a flow that writes 'created_by' to the 'user' field if user is left blank. But that seems like a silly work around.
  • Suggested answer
    RobBallantyne Profile Picture
    17 on at
    I just figured it out... Use the canvas LookUp() and User() functions to figure out the dataverse user object.
     
    Here is my implementation:
     
    If(Form1.Mode = FormMode.NewLookUp(UsersUser().Email = 'Primary Email'), ThisItem.User)
     
    I used this formula in the DefaultSelectedItems property on the data card value. Users is the dataverse table I am looking up. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard