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

Combobox loses value using patch

Hi,

 

I have combobox office 365user. When I use patch command, it defaults to null and does not retain the name value. I need it so that I can pull lookup employee id from my sharepoint list. Is there a way that combobox retain the value once patch comman

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @derrickd ,

Which data source do you use in your app? Is it a SP List?

Which type column do you use to store the ComboBox selected value? Could you please share more details about the 

Further, do you use Patch function to patch data back to your data source?

 

If you want the ComboBox to remain the selected value after executing Patch function, please take a try with the following workaround:

1. If the ComboBox connects to a Person field in your SP List:

Set the OnSelect property of the "Submit" button to following:

 

Set(
    SubmittedRecord,
    Patch(...)       /* <-- Type your Patch formula */
)

 

then set the DefaultSelectedItems property of the ComboBox to following:

 

SubmittedRecord.PersonField

 

 

2. If the ComboBox's Items property set to Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}) formula, and you used a Text column in your data source to store the ComboBox Selected value:

Set the OnSelect property of the "Submit" button to following:

 

Set(
    SubmittedRecord,
    Patch(...)       /* <-- Type your Patch formula */
)

 

then set the DefaultSelectedItems property of the ComboBox to following:

 

LookUp(
        Office365Users.SearchUser(),
        DisplayName = SubmittedRecord.TextTypeColumn
)

 

 

3. If the ComboBox's Items property set to Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}) formula, and you use a Person type column in your SP list to store the selected value:

Set the OnSelect property of the "Submit" button to following:

 

Set(
    SubmittedRecord,
    Patch(...)       /* <-- Type your Patch formula */
)

 

then set the DefaultSelectedItems property of the ComboBox to following:

 

LookUp(
        Office365Users.SearchUser(),
        DisplayName = SubmittedRecord.PersonColumn.DisplayName
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @derrickd ,

Which data source do you use in your app? Is it a SP List?

Which type column do you use to store the ComboBox selected value? Could you please share more details about the 

Further, do you use Patch function to patch data back to your data source?

 

If you want the ComboBox to remain the selected value after executing Patch function, please take a try with the following workaround:

1. If the ComboBox connects to a Person field in your SP List:

Set the OnSelect property of the "Submit" button to following:

 

Set(
    SubmittedRecord,
    Patch(...)       /* <-- Type your Patch formula */
)

 

then set the DefaultSelectedItems property of the ComboBox to following:

 

SubmittedRecord.PersonField

 

 

2. If the ComboBox's Items property set to Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}) formula, and you used a Text column in your data source to store the ComboBox Selected value:

Set the OnSelect property of the "Submit" button to following:

 

Set(
    SubmittedRecord,
    Patch(...)       /* <-- Type your Patch formula */
)

 

then set the DefaultSelectedItems property of the ComboBox to following:

 

LookUp(
        Office365Users.SearchUser(),
        DisplayName = SubmittedRecord.TextTypeColumn
)

 

 

3. If the ComboBox's Items property set to Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}) formula, and you use a Person type column in your SP list to store the selected value:

Set the OnSelect property of the "Submit" button to following:

 

Set(
    SubmittedRecord,
    Patch(...)       /* <-- Type your Patch formula */
)

 

then set the DefaultSelectedItems property of the ComboBox to following:

 

LookUp(
        Office365Users.SearchUser(),
        DisplayName = SubmittedRecord.PersonColumn.DisplayName
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @v-xida-msft 

 

Thanks for your solution - I was hoping you might be able to help me with a similar problem I'm encountering.

 

Below is a picture of my patch function. It is working in its entirety except the combobox field (Approved Resources, top right) isn't saving the selected values when the save button is pressed (on select = patch, which is the function shown)

 

When I press patch, the values for the other non-combobox fields are saved and a new record is produced below (as intended). Note that my patch function successfully collects the values from the combobox, it just doesn't show them in the field (example, "3 selected") when I press my patch button.

 

PATCH.PNG

 

If you have any insight that would be helpful. Thank you!

 

Best,

Steven

Helpful resources

Announcements
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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