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

Update Sharepoint list - Edit Form & Default selected items in Custom combo box

Dear all,

 

Please need a help on below scenario.

I have a SharePoint list which has two custom forms in Main-List(A).  Two custom forms namely NewForm & EditForm. In both the forms I have two custom combo boxes to pull the values from different child list(B).

 

Scenario 1:

In New form, I have two custom combo boxes which fulls the values from child list(B). combo box1 has value from Product field and combox box2 has value from Productgroup field. Based on the Product field I can able to filter the values in Product group. And I am selecting the values from both combo box1 and combo box 2 and get it saved in Main - List(A).

Scenario 2:

Here, is the problem, I am not able to retrieve the values from the main-list(A) to the custom combo boxes in the edit form. The values exist in the main-list(A) should have been selected as a defaultselecteditems in those combo boxes. 

 

In Main list those values are stored in choice field and I should bring those in Editform comboboxes by default. Also I should update the values in Main-List(A).

Please let me know if anyone has faced this scenario and have any input on the same. Thanks !!

 

- Dhana

 

1 ACCEPTED SOLUTION

Accepted Solutions

Dear All,

 

To : @MarvinBangert @v-yutliu-msft 

Thank you so much for your help. Here is my solution.

 

Problem Statement: I have two custom combo boxes(ComboBox1, ComboBox2) in PowerApps form. Here i have tried to retrieve the values from two sharepoint  list fields. ComboBox1 should pull value from Product Field and ComboBox2 should be from ProductGroup Field.

 

Solution:

 

ListName = Interview Schedules

Add Two ComboBoxes through insert command in PowerApps Form and name it like ComboBox1 and ComboBox2.

 

In ComboBox1, the items property should be 'Interview Schedules'.Product. Defaultselecteditems property should be --> Filter(Choices('Interview Schedules'.AppplicableTo), Value in DataCardValue6.SelectedItems.Value).

 

Next comboBox2, it is cascading combobox based the value you select in ComboBox1 the respective values will be populated. so its items property should be --> Filter(Applicants,'Product' in ComboBox1.SelectedItems.'Product') . DefaultSelecteditems property should be --> Filter(Choices('Interview Schedules'.ProductGroup), Value in DataCardValue5.SelectedItems.Value)

 

Hence, Issue resolved.

View solution in original post

3 REPLIES 3
MarvinBangert
Responsive Resident
Responsive Resident

Hey @Dhanasekaran_G 

 

can you please share some more information about your SharePoint list and your Power App? Screenshots also help.

Is "Fill In" enabled within your SharePoint list column?

What is the value of your "DefaultSelectedItems" function?

 

I created a list with a choice field "Choice", enabled multiple values and fill in option. "DefaultSelectedItems" = "Parent.Default" within my Power Apps form (just added from SharePoint list as DataCard).

When I edit an existing item, I can see that there are to items selected and if I open it, I can see which one:

Image 837.pngImage 838.png

 

Kind regards

Marvin

 

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

v-yutliu-msft
Community Support
Community Support

Hi @Dhanasekaran_G ,

Do you want to use data selected from two combo boxes to update a choice column in list A?
Also, combo box1 and combo box2 data comes from listB.

Do you mean that section1+section2 =choice field in listA?

Could you tell me

1)the data type of Product field and  Productgroup field in listB?

2)the structure of your choices of this choice field in listA? is "section1 section2" or "section1,section2"?

I assume that they are all text type, the choice field structure is "section1,section2".

Please notice that the choices of the choice column need to be defined before you update.

You can not create choices in powerapps.

 

I've made a similar test for your reference:

1)combo box1:

Items:

Distinct(listB,Product)

 DefaultSelectedItems:

First(Split(ThisItem.choicefieldname.Value,","))

// if choice field structure is "section1,section2", then the choice field is like : {Value:section1,section2}

ThisItem.choicefieldname.Value represents section1,section2, to get section1, you need to use Split and First function.

2)

combo box2:

Items:

 

Distinct(Filter(listB,Product=combo box1.Selected.Result),Product group)

 

 DefaultSelectedItems:

 

Last(Split(ThisItem.choicefieldname.Value,","))

 

//ThisItem.choicefieldname.Value represents section1,section2, to get section2, you need to use Split and Last function.

 

3)This datacard's Update:

{Value:Concatenate(combo box1.Selected.Result,",",combo box2.Selected.Result)}

 

 

Best regards,

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

Dear All,

 

To : @MarvinBangert @v-yutliu-msft 

Thank you so much for your help. Here is my solution.

 

Problem Statement: I have two custom combo boxes(ComboBox1, ComboBox2) in PowerApps form. Here i have tried to retrieve the values from two sharepoint  list fields. ComboBox1 should pull value from Product Field and ComboBox2 should be from ProductGroup Field.

 

Solution:

 

ListName = Interview Schedules

Add Two ComboBoxes through insert command in PowerApps Form and name it like ComboBox1 and ComboBox2.

 

In ComboBox1, the items property should be 'Interview Schedules'.Product. Defaultselecteditems property should be --> Filter(Choices('Interview Schedules'.AppplicableTo), Value in DataCardValue6.SelectedItems.Value).

 

Next comboBox2, it is cascading combobox based the value you select in ComboBox1 the respective values will be populated. so its items property should be --> Filter(Applicants,'Product' in ComboBox1.SelectedItems.'Product') . DefaultSelecteditems property should be --> Filter(Choices('Interview Schedules'.ProductGroup), Value in DataCardValue5.SelectedItems.Value)

 

Hence, Issue resolved.

View solution in original post

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (81,457)