cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
derrickd
Level: Powered On

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 Team
Community Support Team

Re: Combobox loses value using patch

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 Team
Community Support Team

Re: Combobox loses value using patch

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

Microsoft Costanti
Microsoft

Re: Combobox loses value using patch

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,009)