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 539

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:
  • 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
    539 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
    539 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

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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard