Using the following Patch function:
Patch(
FCTminutes,
Defaults(FCTminutes),
{
Title: dpSchool.SelectedText.Value,
Date: DateTimeValue(DatePickerMinutes.SelectedDate),
'FCT Name': txtFCTname.Text,
});
I am trying to add code to patch all items selected from the cboCQ multi-select combo box to the multi-select choice column (CriticalQuestion). In test the farthest I've been able to pull of a successful patch is by manually adding one choice value like this:
CriticalQuestion:Table(
{
Value: "Q1 What do we want all students to learn?",
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"})
That works fine but what I REALLY to do is patch all "selected" items from the cboCQ multi-select combo box. All other coding attempts throws errors.
Like this code throws an error:
CriticalQuestion:Table(
{
Value: cboCQ.SelectedItems,
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"})
Any help would be most appreciated.
Thank Warren! That worked like a charm! Appreciate the time you took to work this with me.
@Raizo ,
The next question is what is the field name you are displaying in the Combo Box - select the Combo Box and then Edit from the right panel - it will be the Primary Text value. Whatever this is needs to be put in the code as below
CriticalQuestion:
ForAll(
cboCQ.SelectedItems As _CQ,
{Value: _CQ.YourFieldName}
)
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.
MVP (Business Applications) Visit my blog Practical Power Apps
Thanks Warren,
Let me answer your questions:
cboCQ has "SelectMultiple" set as 'true' under properties.
CriticalQuestion column has "allow multiple selections" set to yes.
The items property of the combo box is set to a collection called CriticalQ (see screenshot)
@Raizo ,
The structure is correct (I use it regularly) on the assumption that: -
What is the Items of the Combo Box ? You also seem to me missing a commas after the last bracket if there are fields following this.
Thanks but no go... Thoughts?
@Raizo ,
Missing a comma - now fixed
Thanks Warren!
Was real hopeful but got this error:
Thoughts?
Hi @Raizo ,
Try
CriticalQuestion:
ForAll(
cboCQ.SelectedItems As _CQ,
{Value: _CQ.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.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,786
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional