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 / Patch and SubmitForm t...
Power Apps
Answered

Patch and SubmitForm to the same Sharepoint List

(0) ShareShare
ReportReport
Posted on by 511

Hello.

 

I want to Patch my text Inputs to a Sharepoint List and after that i want to attach a file to the recently created list entry.

 

I have made a custom form with text inputs/dropdown/datepickers/choices for company needs.

I am useing Patch to write all the text inputs. And i have a Single Form for the Attachments that i want to submit too.

 

As far as i can get it to work the formula is creating 2 records 1 with the data and 1 empty with just the attachment.

 

How can i solve this or do i need to use a edit form control? My Formula..

 

Patch(
'Training Request',
{
Title: Title_Input.Text,
Costcenter: Costcenter_input.Text,
Organizer: Organizer_Input.Text,
From_Date: From_Date_Input.SelectedDate,
Till_Date: Till_Date_Input.SelectedDate,
Employee: Employee_Input.Text,
Location: Location_Input.Text,
Costs_Choice: Costs_Choice_Input.Selected,
Costs: Costs_text_Input.Text,
Purpose: Purpose_Input.Text

}

);

SubmitForm(Attachments_Form);

Categories:
I have the same question (0)
  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @niklasjegg 

     

    You can patch a record along with attachment from a separate form by including YourFormName.Updates in your patch function.

     

    Try this:

    Patch(
    'Training Request',
    {
    Title: Title_Input.Text,
    Costcenter: Costcenter_input.Text,
    Organizer: Organizer_Input.Text,
    From_Date: From_Date_Input.SelectedDate,
    Till_Date: Till_Date_Input.SelectedDate,
    Employee: Employee_Input.Text,
    Location: Location_Input.Text,
    Costs_Choice: Costs_Choice_Input.Selected,
    Costs: Costs_text_Input.Text,
    Purpose: Purpose_Input.Text
    
    }
    ,Attachments_Form.Updates
    );

     

     

  • niklasjegg Profile Picture
    511 on at

    Hi @Adrian_Celis  i have edited my Formula but now i am only getting a Blank record in my SPList with just the attachment even though i entered every single field.

  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @niklasjegg 

     

    I just noticed something missing with the patch formula. Are you creating a new item or just updating?

    If you are creating a new item, then you should add Defaults (ListName) to your patch.

     

     

    Patch(
    'Training Request', Defaults('Training Request'),
    {
    Title: Title_Input.Text,
    Costcenter: Costcenter_input.Text,
    Organizer: Organizer_Input.Text,
    From_Date: From_Date_Input.SelectedDate,
    Till_Date: Till_Date_Input.SelectedDate,
    Employee: Employee_Input.Text,
    Location: Location_Input.Text,
    Costs_Choice: Costs_Choice_Input.Selected,
    Costs: Costs_text_Input.Text,
    Purpose: Purpose_Input.Text
    
    }
    ,Attachments_Form.Updates
    );

     

     

  • niklasjegg Profile Picture
    511 on at

    Hi @Adrian_Celis  thank you so much. couldnt sleep last night figuring out a solution 🙂

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    @niklasjegg Glad I could help 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard