cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
egallis
Level 10

Can't save data in Combo Box filled with ClearCollect

On a SharePoint custom form I have the following formula in the OnStart event of FormScreen1:

 

OnStart=ClearCollect(VAR_A;Filter(Datasource_A;Condition_A))

In the form I have a combo box which Items property I set to:

 

Items=VAR_A

The combo box shows indeed only the values from Datasource_A that meet Condition_A. That works fine.

 

But when I create a new item in the list, after choosing a value for the combo box, when I save the form, the chosen value in the combo box is not saved to the SharePoint list. The field is empty in the list item.

 

Anyone knows how to properly configure a combo box which Items property has been set using a collection so that data is saved to the list item ?

 

I found these 2 articles but I've had no luck trying the suggested solutions:

https://powerusers.microsoft.com/t5/General-Discussion/Combobox-saving-issues/m-p/157222/highlight/t...

https://powerusers.microsoft.com/t5/General-Discussion/Can-not-get-LookUp-selection-to-Save-to-my-Li...

 

I think it has something to do with the fact that the data structure of the Items property filled with a ClearCollect is different then the one filled with Choices and that I probably have to change the Default and/or the DefaultSelectedItems of the combo/datacard but I can't figure out exactly how.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Can't save data in Combo Box filled with ClearCollect

Hi @egallis,

 

Do you want to save a value from the Combo box (connected to another data source) into a Lookup column of your SP list within your custom form?

 

I have made a test, and the issue is confirmed on my side. I think this issue is related to the modification of data source the Combo box control connected to.

 

Currently, we could not save a value from the Combo box (connected to another data source) into a Lookup column of a SP list directly. 

 

As an alternative solution, please take a try with the following workaround:10.JPG

 

11.JPG

 

Set the OnStart property of the FormScreen1 to following formula:

 

ClearCollect(VAR_A,Filter('20180920_case7_1',EmailAddress=User().Email))

Note: The '20180920_case7_1' represents the Datasource_A that you mentioned.

 

Set the Items property of the Combo box control within the FavorColor Data card to following:

 

VAR_A

Set the Update property of the FavorColor Data card control to following formula:

 

 

{
 '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Id:LookUp(Colors,ColorName=DataCardValue4.Selected.Color,ID),
  Value:DataCardValue4.Selected.Color
}

Note: The Colors represents the SP list data source which the FavorColor lookup column reference values from. The FavorColor column is a Lookup column in my SP list the current custom form connected to. The Color represents the column within your Datasource_A, which you use to display within the Combo box control.

 

 

On your side, you should type the following formula:

{
 '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Id:LookUp(ReferencedSPList,ReferencedColumnName=DataCardValueX.Selected.DisplayColumn,ID),
  Value:DataCardValueX.Selected.DisplayColumn
}

 

 

Note: The ReferencedSPList represents the SP list your Lookup column reference values from. The ReferencedColumnName represents the column within the ReferencedSPList your Lookup column reference values from. In addition, please also make sure that the values that you selected from the Combo box control have been existed within the ReferencedSPList list.

 

The GIF screenshot as below:

Test1.gif

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-Field-Default-Value-Error/td-p/79481

 

 

Best regards,

Kris

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.
3 REPLIES 3
Rebetcha
Level 10

Re: Can't save data in Combo Box filled with ClearCollect

Hi @egallis, couple of questions:

What type of SharePoint-column are your trying to save the selected combo box value to?

Is the combobox on a form data card? If yes, what is the formula in the Update property of the datacard?

 

egallis
Level 10

Re: Can't save data in Combo Box filled with ClearCollect

Hi @Rebetcha,

 

My column is a lookup column to another SharePoint list and yes it is located in a datacard...

 

At the moment, in my combo Update property I have:

 

DataCardValueX.Selected (X is the number of the datacard)
Highlighted
Community Support Team
Community Support Team

Re: Can't save data in Combo Box filled with ClearCollect

Hi @egallis,

 

Do you want to save a value from the Combo box (connected to another data source) into a Lookup column of your SP list within your custom form?

 

I have made a test, and the issue is confirmed on my side. I think this issue is related to the modification of data source the Combo box control connected to.

 

Currently, we could not save a value from the Combo box (connected to another data source) into a Lookup column of a SP list directly. 

 

As an alternative solution, please take a try with the following workaround:10.JPG

 

11.JPG

 

Set the OnStart property of the FormScreen1 to following formula:

 

ClearCollect(VAR_A,Filter('20180920_case7_1',EmailAddress=User().Email))

Note: The '20180920_case7_1' represents the Datasource_A that you mentioned.

 

Set the Items property of the Combo box control within the FavorColor Data card to following:

 

VAR_A

Set the Update property of the FavorColor Data card control to following formula:

 

 

{
 '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Id:LookUp(Colors,ColorName=DataCardValue4.Selected.Color,ID),
  Value:DataCardValue4.Selected.Color
}

Note: The Colors represents the SP list data source which the FavorColor lookup column reference values from. The FavorColor column is a Lookup column in my SP list the current custom form connected to. The Color represents the column within your Datasource_A, which you use to display within the Combo box control.

 

 

On your side, you should type the following formula:

{
 '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Id:LookUp(ReferencedSPList,ReferencedColumnName=DataCardValueX.Selected.DisplayColumn,ID),
  Value:DataCardValueX.Selected.DisplayColumn
}

 

 

Note: The ReferencedSPList represents the SP list your Lookup column reference values from. The ReferencedColumnName represents the column within the ReferencedSPList your Lookup column reference values from. In addition, please also make sure that the values that you selected from the Combo box control have been existed within the ReferencedSPList list.

 

The GIF screenshot as below:

Test1.gif

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-Field-Default-Value-Error/td-p/79481

 

 

Best regards,

Kris

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.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 194 members 4,583 guests
Recent signins:
Please welcome our newest community members: