cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MadChemist
Helper I
Helper I

Edit Form - Patch Combobox with multiple values

Hello everyone,

 

I have seen the topic around forums, but I still haven't managed to find a proper solution and I was wondering whether somebody has made it.

 

Business Case

I have a Form (Edit/View Form, not just a set of fields I am patching), connecting to a SP list (Projects)

The list has a few columns, but 2 of them are: Region (Choice) and Selling Organization (Choice), where Region is receiving the values from another list (Region_Countries) and the Selling Organization is dependent on the Region (Distinct Filter dependent)

 

Problem

I connect the Form with the SP list, and I replace the dropdowns inside the Form, inside each DataCard, with ComboBoxes.

However, when I try to submit the Form or update an existing entries, I can't do this...

 

Has anyone managed to execute it properly?

 

Thank you in advance!! 

1 ACCEPTED SOLUTION

Accepted Solutions

@WarrenBelz,

Thank you for taking the time to reply. Unfortunately, I am not using "Choices" to define the Items on my DataCards. However, I have to admit that after 10hours of trying to patch, I have solved my issue.

SP list

Region is a choice column, with multi selection option set on yes -> this allows a combobox to appear on the PowerApp when connecting the respective SP list.

Selling Organization is a choice column, with multi selection option set on yes -> this allows a combobox to appear on the PowerApp when connecting the respective SP list.


Values
Region = Distinct(GEO_Hierarchy, Regions)
Selling_Organization = Distinct(Filter(GEO_Hierarchy, Region = RegionComboBox.Selected.Result), Sell_Org)

Now, I am trying to update the Form, using the SubmitForm(New_Project_Form) function (and Form.Updates when I wanted to update a specific record), and I have tried placing inside the Update of the datacard any type of possible input. Some of them worked, some of them didn't, but all of the above were patching blanks on the respective SP columns.

What Worked?
On the Update of the DataCard, I have placed the below:
ForAll(Region_ComboBox.SelectedItems.Result,{Value:Result})

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @MadChemist ,

You need to change the Update of the data card to reflect the new control you have put in. If you have a Choice field you are writing to and the Items of the Combo Box are simply the Choices in the field, then the Update of the Data Card will be

{Value:ComboBoxName.Selected.Value}

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz,

Thank you for taking the time to reply. Unfortunately, I am not using "Choices" to define the Items on my DataCards. However, I have to admit that after 10hours of trying to patch, I have solved my issue.

SP list

Region is a choice column, with multi selection option set on yes -> this allows a combobox to appear on the PowerApp when connecting the respective SP list.

Selling Organization is a choice column, with multi selection option set on yes -> this allows a combobox to appear on the PowerApp when connecting the respective SP list.


Values
Region = Distinct(GEO_Hierarchy, Regions)
Selling_Organization = Distinct(Filter(GEO_Hierarchy, Region = RegionComboBox.Selected.Result), Sell_Org)

Now, I am trying to update the Form, using the SubmitForm(New_Project_Form) function (and Form.Updates when I wanted to update a specific record), and I have tried placing inside the Update of the datacard any type of possible input. Some of them worked, some of them didn't, but all of the above were patching blanks on the respective SP columns.

What Worked?
On the Update of the DataCard, I have placed the below:
ForAll(Region_ComboBox.SelectedItems.Result,{Value:Result})

You may find post from Community Support Team _ Michael Shao helpful: 

https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-patch-a-SharePoint-Lookup-Column/m-p/...

@MadChemist ,

If you had posted the fact that it was multi-select, then I could have provided you with the ForAll() syntax as that is the only way to write to a table (and saved you 10 hours) - likewise Choices and Lookup columns take the .Value syntax (although lookup is a whole new level of complication) whereas the output of Distinct is .Result

I am happy to help here - just the more information you provide, the more chance you have of an accurate response.

I am glad you got it sorted.

Thank you very much @WarrenBelz, I didn't want to imply in any way that the answer you gave me was not helpful - the opposite, it helped me reach faster to the solution!!

What PowerApps is NOT able to do unfortunately is use the "Form.Updates" to patch back MultiSelect fields to the form, when they are NOT modified....

 

Example: If there are values in Region/Selling Organization and I want to update other  entries in the Form i.e. Project Name (but not the above), then I get an "unknown error".
The reasoning behind is that the DefaultSelectedItems shows the values, but they are not actually selected. As a result, the Form.Updates can't patch blanks back and shows error (tried using the formula error management, same) 

Hi @MadChemist ,

What I was trying to point out to help you on your Power Apps journey is that the more accurate you describe your issue, the more chance of you not only getting a quick and accurate reply (and save you a lot of frustrating testing), but also one of the (small group of) regular responders answering your post in front of the dozens of other sometimes vague questions.

I have a blog that may give you some guidance.

 

On your other question (although I do not use Form.Updates or complex field types much), that is an interesting observation I have not seen mentioned before. If you turn on Formula Level Error Management in your Advanced Settings, it may fix the blank Patch issue.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,140)