cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
derrickd
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
v-xida-msft
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
v-xida-msft
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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,518)