cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

How to set the default person in a Dynamics lookup dropdown not SharePoint

I have done this a million times with SharePoint Lookups for person fields...  like this:

{
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        Claims: Concatenate(
            "i:0#.f|membership|",
            User().Email
        ),
        DisplayName: User().FullName,
        Email: User().Email
    }

 

But obvious Dynamics wouldn't need the "SPListExpandedUser"...

 

So, I'm trying this on both the parent default and on the DataCardValue (dropdown) DefaultSelectedItems.

{
    DisplayName: User().FullName,
    Claims: "i:0#.f|membership|" & Lower(User().Email),
    Department: "",
    Email: User().Email,
    JobTitle: "",
    Picture: ""
}

 

But never shows my name when testing, just stays blank?

 

Thanks,

Terry

2 REPLIES 2
Highlighted
Super User II
Super User II

Hi @Mattw112IG 

 

Are you trying to set the default value of a users dropdown to the current logged in user (in CDS)? If so, you don't need any of the SharePoint like code. If the Items property of the dropdown is Users, then you can set the Default property to 

LookUp(Users, 'Primary Email' = User().Email)

or

LookUp(Users, 'User Name'= User().Email)

If these work, I would suggest you first user the current logged in user's email in a separate variable, with something like this in the App's OnStart property: 

Set(gblUserEmail, User().Email)

and then use this variable in the expressions I shared above. This way you will not run into delegation issues. 

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Microsoft Certified Trainer MCT

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

 

Highlighted

I tried what you suggested by still nothing?  I tried using variables and not, just to see.  I tried creating labels to show results, which worked.  But this field seems to want something else?

 

Here's what the card default is set to:

 

Screenshot 2020-11-22 143138.png

 

I tried setting a variable to User().email too and using that to avoid the delegation warning but didn't work either.

 

Terry

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,943)