I have a list in SharePoint (called Reviewers) as a data source with a field called Reviewer which is a people picker field. I have another field in the same list called DefaultNotification with a value of "Primary". I have the Reviewer field on the form and I want to set the default value to the row in the list where the person is the Primary contact. I can't figure out how to set the default to that person. I've found other sources that shows how to filter a list for a text field with a specific value but I haven't found one that will filter out a person based on another value in the form
List Name: Reviews
Fields : Reviewer (people picker)
Default Notification (text field), only one will say Primary
Solved! Go to Solution.
First, make sure your Default on the DataCard hosting that Combobox is set the : ThisItem.AssignedTo (adjust the AssignedTo to reflect the proper name in your datasource).
Next, set the DefaultSelectedItems property of your Combobox to the following:
Coalesce(Parent.Default, LookUp(Reviewers, DefaultNotification = "Primary", Reviewer))
That should give you what you are looking for.
I hope this is helpful for you.
You have a gallery as people picker and a textbox where you start inputing the person's name and you want to return only primaries? you will have to add a Filter() somewhere in there, can you share a screenshot of the app and the code you have for the items of that gallery?
I don't have a gallery in the form but the list is a data source. Can I not filter the list directly in the default value of the people picker or do I need the gallery and filter it there and then set the default value on the people picker field to that record. There will only be one that will be identified in the list as the Primary contact.
Perhaps you can, can you show a screenshot of the code you have for your people picker?
.
I don't have anything on the Default property at the moment. Here are screenshots of my Reviewer list, the form, and my data sources.
The field I want to set a default person is the Assigned to field in the Reviewers data source, from the Reviewer column where the value in the column Default Notification is equal to Primary.
If that is a dropdown box then on Item put this:
Filter('Reviewer', Default Notification= "Primary") then in Value in properties select the field you want to see.
First, make sure your Default on the DataCard hosting that Combobox is set the : ThisItem.AssignedTo (adjust the AssignedTo to reflect the proper name in your datasource).
Next, set the DefaultSelectedItems property of your Combobox to the following:
Coalesce(Parent.Default, LookUp(Reviewers, DefaultNotification = "Primary", Reviewer))
That should give you what you are looking for.
I hope this is helpful for you.
I just now saw this updated message and it worked perfectly. Thank you so much. I've spent hours trying to find a solution.
User | Count |
---|---|
250 | |
102 | |
94 | |
47 | |
37 |