Hi @Anonymous :
Do you want to add values instead of replacing the original values by selecting operations in a combo box?
Could you tell me :
- What are these two gallery’s items property?
- What is the combo box’s items property?
- What are your data sources? Collection? Or SharePoint?
- How did you submit the data? What is the specific formula?
I guess it may be the problem of the code you submitted the data, it overwrites the old value with the new value.
Because the information I obtained is not enough, I will first provide a scheme for adding values ​​based on the original records for your reference:
I assume the combo box allow multiple selections.
Solution1:Target is stored as a string
My data source: MyTest
ClearCollect(
MyTest,
{
Title: 1,
Combovalue: First( /* Combovalue is a field used to store the records selected by combobox */
ComboBoxSample /* predefined collection*/
).Value1
},
{
Title: 2,
Combovalue: Last(
ComboBoxSample
).Value
}
)
Step1:Add a gallery
Items: MyTest
Step2:Add a Combo box(ComboBox1) control into this gallery
Items: ComboBoxSample
DefaultSelectedItems: First(ComboBoxSample) /* Set default selected items*/
Step3:Add a button control into this gallery
Patch(
MyTest,
ThisItem,
{
Combovalue: Concatenate(
Combovalue,
",",
Concat(
ComboBox1.SelectedItems,
Value1 & ","
)
)
}
)
Solution2:Targets are stored in tables
My data source: MyTest
ClearCollect(
MyTest,
{
Title: 1,
Combovalue: FirstN( /* Combovalue is a field used to store the records selected by combobox */
ComboBoxSample, /* predefined collection*/
3
)
},
{
Title: 2,
Combovalue: LastN(
ComboBoxSample,
1
)
}
)
Step1:Add a gallery
Items: MyTest
Step2:Add a Combo box(ComboBox1) control into this gallery
Items: ComboBoxSample
DefaultSelectedItems: First(ComboBoxSample) /* Set default selected items*/
Step3:Add a button control into this gallery
Patch(
MyTest,
ThisItem,
{
Combovalue: Ungroup( /* Integrate the original value and the new value into a new table and assign it to Combovalue */
Table(
{MyTables: Combovalue},
{MyTables: ComboBox1.SelectedItems}
),
"MyTables"
)
}
)
Best Regards,
Bof