web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Attachments saving wit...
Power Apps
Answered

Attachments saving with code Patch not work

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone

Good morning

I have a question.

I have a form as FormNew, but I need integrate the control Attachment, I add in my form and I required SAVE record with the function Patch, NOT Form.Updates.

I attached an image.

 

Regards

Error.png
Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Why are you not using SubmitForm on the form?  All of the things you are doing in the massive If tree can be handled directly in the form.  The only thing you need is SubmitForm.

     

    AND...I say that because you CANNOT patch attachments.  The only solution for submitting attachments is using the SubmitForm.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello Randy

    Thank you for your support

    Before to accept as solution, could you please comment you 2 question.

    1.- If I omite function Path, not problem with save new registers?

    2.- Could you please comment, if my code is good?, attached an image. And if you can view an error or improve in this code, could you please confirm me?
    Thank you 

     

     

    New code with submitform.png
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    So if you are using an Form, then all of the work is done for you.

    Typically, instead of popping up lots of Notify messages, the preferred method is to simply set the datacards you are checking for Blank to be required (Required - true).  The form will then notify the user directly in the form.

     

    As for your Formula:

    1) Again, all of the If statements can go away if you just set those datacards to Required.

    2) SubmitForm is pretty much the only thing you need in your submit button.  Except in your case you will want to wrap that to test the connection:

    If(Connection.Connected && NewForm_1.Valid,
     SubmitForm(NewForm_1),
    
     Notify("La conexión de internet ha fallado, revise su conexión", Warning, 5000)
    )

    3) You do not need to do a Refresh statement on the datasource...it will already be updated.

    4) The OnSuccess action of NewForm_1 should be set to:

    Notify("Elemento guardado", Success, 4000);
    ResetForm(NewForm_1)
    Navigate(BrowseScreen1, Cover);
    
    

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Randy, could you please this image attached?

    Error after submitedform but I have 4 field with connection SQL not SP list in same form- Suppor.png
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Make sure that all of the Update properties in your datacards are referencing the proper controls and converting as required to any data type that is needed for your datasource.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard