Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Having problems with patching a form that has multiselect combobox and attachment

(1) ShareShare
ReportReport
Posted on by

hi,

 

I have a form that is connected to a sharepoint list. One of the field on SP is a multi-select choice column and I also need the option to upload attachments to it.

 

I can patch the form to create a new record with either a multi select choice column like {MC: ComboBox.SelectedItems} or I can patch the form with an attachment by patching the record with form.updates.

 

But when I have both on the same form, patch is giving me an unknown error.

 

Any idea how can I resolve this?

  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Having problems with patching a form that has multiselect combobox and attachment

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Having problems with patching a form that has multiselect combobox and attachment

    Hi @Anonymous ,

    You have some brackets in the wrong places

    If(
     IsEmpty(Errors('PCB Design')),
     Patch(
     'PCB Design'
     Defaults('PCB Design'),
     EditDesignForm.Updates
     )
    )

     

    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.

  • Re: Having problems with patching a form that has multiselect combobox and attachment

    Also when I tried submitform, it is still giving me "An unknown error occured" message.

     

    Edit:

    Not sure what is wrong with the combo box, but when I remove and add the field back I can submitform successfully again. But that still wouldn't give me what I want -> to create a new record when I got the button with the combo box and attachments.

  • Re: Having problems with patching a form that has multiselect combobox and attachment

    hi Randy,

    I am trying to create a new record every time the user click the submit button instead of updating the existing record for traceability. I dont think submit form can create a new record for me.

     

    The screenshot below shows my original formula before I added the combobox for the multi-select column. It was able to create a new record and upload the new attachments without error. After I added the combobox it gave me the error as shown in the picture.

     updates error.png

     

    Then I tried to change the patch formula and manually type in every field/datacardvalue, that works for the combobox for the multi-select column, but I will getting an error when I add {Attachments: Datacardvalue.attachments} to the formula.

     

    The formula below is what I have that works with the multi-select column but not with attachments.

    Patch('Design', Defaults(' Design'), {PN: DataCardValue1.Text}, {Rev: DataCardValue2.Text}, {TestMethod: ComboBox1.SelectedItems}, {Comment: DataCardValue3.Text})

     

    Adding attachments at the end like this gives me an error in the formula:

    Patch('Design', Defaults(' Design'), {PN: DataCardValue1.Text}, {Rev: DataCardValue2.Text}, {TestMethod: ComboBox1.SelectedItems}, {Comment: DataCardValue3.Text}, {Attachments: DataCardValue4.Attachments)

     

  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Having problems with patching a form that has multiselect combobox and attachment

    @Anonymous 

    Is there any reason that you are using a Form and then using Patch on it?  If you are going to use a form, the SubmitForm button should do most all of the heavy lifting for you.  It fully supports multi-select choices and attachments both.

     

    If there is a particular reason, then also provide some of your formulas that you are getting and error on and any screenshots (if relevant). 

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard