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

Notifications

Announcements

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 505

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
    505 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
    505 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard