cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (5,563)