cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StevenCollier
Frequent Visitor

Setting Default for people field

I have a SharePoint list with two people fields, I want both to be selectable but have an option to copy the value from one to the other. I think I'm nearly there but introducing changes to default seems to destroy the email address lookup.

 

So far I've added a button called Copy and use it to toggle a contect HasBeenPressed

 

When pressed I want to set the default for Card6 to match the value in card 5 so I set the default to

 

If(HasBeenPressed,DataCardValue5.Selected,ThisItem.Headset_x0020_for)

 

now when I press the button I get the value copied, but when I don't the list is empty and won't find email addresses. I guess I need to get entries into Value 1 and 2 but can't see how to reference them.

 

Maybe there's a simpler way!

1 ACCEPTED SOLUTION

Accepted Solutions

It's not a listbox with an items element, it looks like one but has a special behaviour to find users within the SharePointuser list.

 

I did get it working by setting the default value of the DataCardValue intead of the card, but don't really know why.

 

It would be great if someone published some good information on how sharepoint lists with lookup values actually work in PowerView.

View solution in original post

4 REPLIES 4
Meneghino
Community Champion
Community Champion

Hello Steven,

it seems that you are doing everything correctly.  The only thing I would suggest is that you may need a .Email or something like it after the Headset_x0020_for in your DataCard6.Default expression.  This is because a people column is actually a record and not a variable, so you need to specify a field.

Please let me know how you get on or if you need more guidance.

 

Some clarifications here:

https://powerusers.microsoft.com/t5/PowerApps-Forum/SharePoint-List-Update-Person-Field/m-p/6980/hig...

No, if I add .Email it errors as it wants a record and not a value.

 

It would help if there was some kind of logic to explain what is actually happening with these people lookups. In the autogenerated card the default is set to ThisItem.fieldname, with email and displaynames as value 1 and value 2.

 

How does that pull a list of all the users in the directory ?

What's the purpose of value1 and value 2, and how can they be referenced in code?

 

It doesn't really make any sense to me.

Hi Steven, sorry that the quick suggestion did not work.

What is the main control in the two people datacards, is it a dropdown?  If so, what are their respective Items property?  This is the property that defines the list of choices.

It's not a listbox with an items element, it looks like one but has a special behaviour to find users within the SharePointuser list.

 

I did get it working by setting the default value of the DataCardValue intead of the card, but don't really know why.

 

It would be great if someone published some good information on how sharepoint lists with lookup values actually work in PowerView.

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,157)