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 / Power Apps Collection ...
Power Apps
Unanswered

Power Apps Collection is submitting data to SharePoint 3 times.

(0) ShareShare
ReportReport
Posted on by 492
Good day
 
I need your help.
 
I created an app with add row gallery so that users can add more rows if they have to.
 
So, on the OnStart properties I have this syntax: 
ClearCollect(Col_AccessForm,{'Source System Name':"",'Source IP-Address':"",'Destination System Name':"",'Destination IP-Address':"",'Tester''s Company/Department':"",'Destination Port/s':"", 'VPN/Lease':""})
this is for collecting the fields from the list
 
I then created a gallery with fields and an add row button. This button has the following syntax:
// Add a new row
Collect(Col_AccessForm, {
    'Source System Name': TextInput2.Text,
    'Source IP-Address': TextInput2_2.Text,
    'Destination System Name': TextInput2_3.Text,
    'Destination IP-Address': TextInput2_4.Text,
    'Destination Port/s': TextInput2_5.Text,
    'VPN/Lease': TextInput2_6.Text
});
 
// Debugging: Display the contents of Col_AccessForm
Label1.Text = First(Col_AccessForm).'Source System Name';
Label2.Text = First(Col_AccessForm).'Source IP-Address';
Label3.Text = First(Col_AccessForm).'Destination System Name';
Label4.Text = First(Col_AccessForm).'Destination IP-Address';
Label5.Text = First(Col_AccessForm).'Destination Port/s';
Label6.Text = First(Col_AccessForm).'VPN/Lease';
 
I had to debug since multiple rows were added instead of one row. Fine.
 
To combine both canvas data and gallery data and then submit to my list, I added the following syntaxes:
 
ClearCollect(CanvasData, {'Applicant''s Full Name': ComboBox2.Selected,'Applicant''s Company/Department':TextInput3_1.Text, 'Applicant''s Phone': TextInput3_2.Text,'Applicant''s Cell': TextInput3_3,'Applicant''s email': TextInput3_4.Text,'Tester''s Full Name': ComboBox3.Selected,'Tester''s Company/Department': TextInput3_6.Text, 'Tester''s Phone': TextInput3_7.Text, 'Tester''s Cell':TextInput3_8.Text,'Tester''s email':TextInput3_9.Text, 'Reasons for Application': TextInput4.Text, 'Manager of Applicant':ComboBox1.Selected, Approved:Dropdown28.Selected.Value, 'IT Security Manager':TextInput5.Text});
 
ClearCollect(GalleryData,
    ForAll(Gallery8.AllItems, {'Source System Name':TextInput2.Text,'Source IP-Address': TextInput2_2, 'Destination System Name':TextInput2_3, 'Destination IP-Address':TextInput2_4, 'Destination Port/s': TextInput2_5, 'VPN/Lease': TextInput2_6.Text}));
 
    ClearCollect(CombinedData, CanvasData, GalleryData);
   
    ForAll(CombinedData,
    Patch('Network Access Form', Defaults('Network Access Form'), {
        'Applicant''s Full Name': ComboBox2,
        'Applicant''s Company/Department': TextInput3_1.Text,
        'Applicant''s Phone': TextInput3_2.Text,
        'Applicant''s Cell': TextInput3_3.Text,
        'Applicant''s email': TextInput3_4.Text,
        'Tester''s Full Name': ComboBox3,
        'Tester''s Company/Department': TextInput3_6.Text,
        'Tester''s Phone': TextInput3_7.Text,
        'Tester''s Cell': TextInput3_8.Text,
        'Tester''s email': TextInput3_9.Text,
        'Source System Name': TextInput2.Text,
        'Source IP-Address': TextInput2_2.Text,
        'Destination System Name': TextInput2_3.Text,
        'Destination IP-Address': TextInput2_4.Text,
        'Destination Port/s': TextInput2_5.Text,
        'VPN/Lease': TextInput2_6.Text
    })
);
 
They all work fine, and the data does get submitted as one data but now it's getting multiplied 3 times:
 
 
Your help is always appreciated.
 
Thank you
Categories:
I have the same question (0)
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,099 Super User 2025 Season 2 on at
    Hey, 
     
    To Could you go and look into the Collections what is saved there?
     
    If this solvede your porblem please accept it as solution so others can find it as well. 
    If it helped in any other way consider liking it so we can keep supporting eachother. 
  • NN-21081740-0 Profile Picture
    492 on at
    Hi @DBO_DV
     
    Thank you for your quick reply.
     
    There's only one row and it's coming from the gallery collection:
     
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,099 Super User 2025 Season 2 on at
    Could you try to make some Test entrys but without sendsding the data So you would comment the ForAll part out 
    with /* and */ at the end of the forAll formula. 
    And then look at it again. 
     
    Since according to your explanation col_Accessform gets created onStart with exactly this empty record. 
     
    If this solvede your porblem please accept it as solution so others can find it as well. 
    If it helped in any other way consider liking it so we can keep supporting eachother. 
  • timl Profile Picture
    36,319 Super User 2025 Season 2 on at
    Hi NN-21081740-0 
     
    I assume you took this screenshot before you added a row, which explains why it contains a blank row. 
     
    This is what I believe is happening:
    • OnStart adds 1 row to Col_AccessForm
    • The Add row button adds 1 row  to Col_AccessForm 
    • Gallery8.AllItems contains 1 row 
       
    This gives a total of 3 rows.
     
    Your call to ForAll/Patch incorrectly references the text input control values rather than the value in the CombinedData collection. (eg, 'Applicant''s Phone': TextInput3_2.Text)

    This would explain why 3 rows are patched, each containing the values that are present in the data entry controls.
     
        ForAll(CombinedData,
        Patch('Network Access Form', Defaults('Network Access Form'), {
            'Applicant''s Full Name': ComboBox2,
            'Applicant''s Company/Department': TextInput3_1.Text,
            'Applicant''s Phone': TextInput3_2.Text,
            'Applicant''s Cell': TextInput3_3.Text,
            'Applicant''s email': TextInput3_4.Text,
            'Tester''s Full Name': ComboBox3,
            'Tester''s Company/Department': TextInput3_6.Text,
            'Tester''s Phone': TextInput3_7.Text,
            'Tester''s Cell': TextInput3_8.Text,
            'Tester''s email': TextInput3_9.Text,
            'Source System Name': TextInput2.Text,
            'Source IP-Address': TextInput2_2.Text,
            'Destination System Name': TextInput2_3.Text,
            'Destination IP-Address': TextInput2_4.Text,
            'Destination Port/s': TextInput2_5.Text,
            'VPN/Lease': TextInput2_6.Text
        })
    );
     
     
     
  • NN-21081740-0 Profile Picture
    492 on at
    @DBO_DV
     
    I blocked the ForAll syntax as advised, and this is what I got generated in the collections:
     
    2 rows for combined and 1 for the rest of the collections.
     
    By the way I deleted the empty row prior running the collections.
     
  • NN-21081740-0 Profile Picture
    492 on at
    After removing the empty row in the gallery, the submission is now duplicated. I am close to resolving the issue. From three submission to two. I have removed the Onstart collection syntax, and the rows are still adding fine which means nothing is broken, but the submission is duplicated.
     
     
  • Daniel Bocklandt Profile Picture
    5,099 Super User 2025 Season 2 on at
    Hey,
     
    so timl is right. Since you referenced the textinputs instead of the column sof your collection you have 3 times the same data. 
     
    By replacing the textInputs with the columns it should work as timl pointed out so rightfully. 
  • timl Profile Picture
    36,319 Super User 2025 Season 2 on at
     
    Thanks DBO_DV,
     
    As I mentioned earlier, the correct syntax would look something like this:
     
    ForAll(CombinedData,
        Patch('Network Access Form', Defaults('Network Access Form'), {
            'Applicant''s Full Name': ThisRecord.'Applicant''s Full Name',
            'Applicant''s Company/Department': ThisRecord.'Applicant''s Company/Department',
            'Applicant''s Phone': ThisRecord.'Applicant''s Phone',
            'Applicant''s Cell': ThisRecord.'Applicant''s Cell',
            'Applicant''s email': ThisRecord.'Applicant''s email',
            'Tester''s Full Name': ThisRecord.'Tester''s Full Name',
            'Tester''s Company/Department': ThisRecord.'Tester''s Company/Department',
            'Tester''s Phone': ThisRecord.'Tester''s Phone',
            'Tester''s Cell': ThisRecord.'Tester''s Cell',
            'Tester''s email': ThisRecord.'Tester''s email',
            'Source System Name': ThisRecord.'Source System Name',
            'Source IP-Address': ThisRecord.'Source IP-Address',
            'Destination System Name': ThisRecord.'Destination System Name',
            'Destination IP-Address': ThisRecord.'Destination IP-Address',
            'Destination Port/s': ThisRecord.'Destination Port/s',
            'VPN/Lease': ThisRecord.'VPN/Lease'
        })
    )
     
  • NN-21081740-0 Profile Picture
    492 on at
    the list columns are on the left and on my right are the PowerApps fields. So, you guys are saying I must add columns for columns, like so:
     
    Applicant''s Full Name': Applicant''s Full Name?
  • timl Profile Picture
    36,319 Super User 2025 Season 2 on at
    Hi NN-21081740-0, 
     
    Yes that's correct.  The right hand side would need to refer to the column name in CombinedData so it would look either be
     
    'Applicant''s Full Name': 'Applicant''s Full Name'
    
    or
    
    'Applicant''s Full Name': ThisRecord.'Applicant''s Full Name'
    

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard