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:
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.
Hi @Anonymous,
First of all, do not use the @odata.type thing in your formulas anymore. It's useless now. Setting a value for a lookup is as easy as using the following structure:
{
Id: <id>,
Value: <value>
}
About your problem, could you please post a capture on which we can see where the formula is located? On which control and which property?
Thanks...
Hi
I have used the same formula, but it is not saving the data of combobox , please help me
Hi @R3dKap,
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:
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:
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
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)
Hi @R3dKap, 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?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.