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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

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

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (70,809)