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 / Saving the form in two...
Power Apps
Unanswered

Saving the form in two different Sharepoint lists

(0) ShareShare
ReportReport
Posted on by 42

Good afternoon to everyone,

I hope you can help me with this.

My goal is to save a form in two different Sharepoint lists, called "Form 1" and "Form 1.2". 

The code that I´ve been used so far is this one:

 

Patch('Form 1.2',Defaults('Form 1.2'),{'Name Kontrollmitarbeiter ':DataCardValue7.Text});Patch('Form 1',Defaults('Form 1'),{'Name Kontrollmitarbeiter ':DataCardValue7.Text});

 

But Power App gave me some error messages, basically he cannot read the ´Name Kontrollmitarbeiter´ card. ´DataCardValue7´ is the text box inside the previous datacard. 

Thank you in advance for your help!

Categories:
I have the same question (0)
  • Chris-D Profile Picture
    1,246 on at

    It looks like you might have a space that shouldn't be there? 

     

    'Name Kontrollmitarbeiter '
     ^

     

    Try removing that?

    I can't see anything wrong other than that. If that doesn't fix it can you show a screenshot with the exact error please? 

  • mtere Profile Picture
    42 on at

    Hello, thanks for the hint, fortunately I managed to solve the problem. 

    But I still have issues related to it, on Sharepoint. 

    When I fill the form on Power App, I press safe and the form is saved on 2 different Sharepoint lists. BUT, I can see no data saved on the lists, even though I typed some names, numbers etc on Power Apps. 

    I can attach a screen about what I see after saving my form.

    P.S: this issue is on both lists on Sharepoint. 

    mtere_0-1693914894864.png

    mtere_1-1693914966213.png

     

    Tables are not supposed to be blank because the form was filled with data, on Power App. 

    Thank you again for your help,

    M

     

  • Chris-D Profile Picture
    1,246 on at

    Let's have a look at your Patch() function:

    Patch(
     // Data source
     'Form 1.2',
    
     // Record to patch, Defaults creates a new record
     Defaults('Form 1.2'),
    
     // Data to insert
     {
     'Name Kontrollmitarbeiter': DataCardValue7.Text
     }
    );

     

    You are only saving the data for the 'Name Kontrollmitarbeiter' column.

  • mtere Profile Picture
    42 on at

    Thank you so much. 

    Do you have any suggestions on how to use a form as a record?

    For example, I´m using this formula: 

    Patch('Form 3',Defaults('Form 3'), [Form5_2.LastSubmit]);Patch('Form 1',Defaults('Form 1'), [Form5_2.Updates]);

    I want to save the whole form but Power App tells me that this code is invalid. 

    As you can see I used ".LastSubmit" and ".Updates" and still doesn´t work. 

    Thank you in advance for your help, 

    M

  • Chris-D Profile Picture
    1,246 on at

    I'm not quite sure what you're trying to do with that code but using Patch( Data, Defaults(), ...) will always create a new record. 

     

    Can you explain what you're trying to achieve? 

  • mtere Profile Picture
    42 on at

    Sure. 

    I'm trying to save my form, 'Form5_2,' to two different SharePoint lists.

    M

  • Verified answer
    Chris-D Profile Picture
    1,246 on at

    ok, I was confused by LastSubmit. You don't need this here. 

     

    This should work, with a few less [ ]'s:

    Patch( 'Form 3', Defaults( 'Form 3'), Form5_2.Updates);
    Patch( 'Form 1', Defaults( 'Form 1'), Form5_2.Updates);

     

    This will always create new records though. You can't use this method to update existing records. To update like this you'd have to supply the ID but you can't get that from the Form control.

    // MyRecord would be the same data source that you're passing to the form
    Patch( 'Form 3', { ID: MyRecord.ID}, Form5_2.Updates);
    Patch( 'Form 1', { ID: MyRecord.ID}, Form5_2.Updates);

     

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard