Skip to main content

Notifications

Community site session details

Community site session details

Session Id : cTcD6O/NExAsg4aQlHnU2V
Power Apps - Building Power Apps
Answered

Patch all selected items from combo box to multi-select choice column in sharepoint list

Like (0) ShareShare
ReportReport
Posted on 30 May 2024 22:39:08 by 66

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. 

Categories:
  • Raizo Profile Picture
    66 on 31 May 2024 at 04:18:17
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    Thank Warren! That worked like a charm! Appreciate the time you took to work this with me. 

  • Verified answer
    WarrenBelz Profile Picture
    146,786 Most Valuable Professional on 31 May 2024 at 01:18:22
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    @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

     

  • Raizo Profile Picture
    66 on 31 May 2024 at 00:35:38
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    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) screenshot 3.png

  • WarrenBelz Profile Picture
    146,786 Most Valuable Professional on 31 May 2024 at 00:10:42
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    @Raizo ,

    The structure is correct (I use it regularly) on the assumption that: -

    • cboCQ is a multi-select Combo Box with the output of .Value
    • CriticalQuestion is a multi-value Choice field

    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.

  • Raizo Profile Picture
    66 on 30 May 2024 at 23:51:15
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    Thanks but no go...  Thoughts?screenshot 2.pngscreenshot 1.png

  • WarrenBelz Profile Picture
    146,786 Most Valuable Professional on 30 May 2024 at 23:47:49
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    @Raizo ,

    Missing a comma - now fixed

  • Raizo Profile Picture
    66 on 30 May 2024 at 23:32:45
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    Thanks Warren! 

     

    Was real hopeful but got this error:
    screenshot 2.pngscreenshot 1.png

     

    Thoughts?

  • WarrenBelz Profile Picture
    146,786 Most Valuable Professional on 30 May 2024 at 23:10:40
    Re: Patch all selected items from combo box to multi-select choice column in sharepoint list

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,786 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard