cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kORINNERBGIS
New Member

Sharepoint List Duplication

Hi I have created an app that links to a sharepoint list via patch 

 

However when I press the submit button it seems to create multiple duplicate lines in the sharepoint list, can you advise? formula being used for the button below.

 

ClearCollect(Collection, 'Innovation Survey');ForAll(Collection,Patch('Innovation Survey',{'What are the biggest challenges you face when trying to implement Innovation/ Technologythe biggest ':TextInput3.Text},{'Do you feel you have sufficient training & skills to successfully deliver the requirements of your role?':Dropdown2_1.SelectedText},{'Is there any training/development you feel BGIS could provide in order to bridge those gaps?':Dropdown2_2.SelectedText},{'do you know your client''s top 3-4 challenges are?':TextInput4.Text},{'what involvement do you have in solving them?':Dropdown2_4.SelectedText},{'if never - what is the reason?':TextInput1.Text},{'Is there any technology you feel BGIS could implement/deploy to make your role easier?':TextInput2.Text},{'what industry innovation have you seen that would benfit BGIS and it''s clients?':TextInput2_1.Text},{'Have you brought forward an innovation for your account in the past?':If(Radio1.Selected.Value="No",false,true)},{'Account Name':{Value:ComboBox1.Selected.Result,Id:LookUp('Locations and Contracts-fd5b7153-67d8-4fc6-9f1b-b846cf8fb4f4','Account Name' = ComboBox1.Selected.Result).ID}}));Reset(Dropdown1); Reset(ComboBox1);Reset(Dropdown1_2); Reset(Dropdown1_3);Reset(Dropdown2_1);Reset(Dropdown2_2);Reset(Dropdown2_2);Reset(Dropdown2_4);Reset(Radio1);Reset(TextInput1);Reset(TextInput2);Reset(TextInput2_1);Reset(TextInput2_2);Reset(TextInput3);Reset(TextInput4); Notify("Thank you, your response has been submitted",NotificationType.Success);Navigate(Screen2)

1 ACCEPTED SOLUTION

Accepted Solutions

I think in this case you can just patch it with collecting the whole datasource into a collection, like this:

(apologies, my editor may have messed up the column names for the items containing apostrophes so you may need to clean up those)

 

Patch(
      'Innovation Survey',
    {
        'What are the biggest challenges you face when trying to implement Innovation/ Technologythe biggest ': TextInput3.Text,
        'Do you feel you have sufficient training & skills to successfully deliver the requirements of your role?': Dropdown2_1.SelectedText,
        'Is there any training/development you feel BGIS could provide in order to bridge those gaps?': Dropdown2_2.SelectedText,
        'do you know your client''s top 3-4 challenges are?': TextInput4.Text,
        'what involvement do you have in solving them?': Dropdown2_4.SelectedText,
        'if never - what is the reason?': TextInput1.Text,
        'Is there any technology you feel BGIS could implement/deploy to make your role easier?': TextInput2.Text,
        'what industry innovation have you seen that would benfit BGIS and it''s clients?': TextInput2_1.Text,
        'Have you brought forward an innovation for your account in the past?': If(Radio1.Selected.Value = "No", false, true),
        'Account Name': {
            Value: ComboBox1.Selected.Result,
            Id: LookUp('Locations and Contracts-fd5b7153-67d8-4fc6-9f1b-b846cf8fb4f4', 'Account Name' = ComboBox1.Selected.Result).ID
        }
    }
);
Reset(Dropdown1);
Reset(ComboBox1);
Reset(Dropdown1_2);
Reset(Dropdown1_3);
Reset(Dropdown2_1);
Reset(Dropdown2_2);
Reset(Dropdown2_2);
Reset(Dropdown2_4);
Reset(Radio1);
Reset(TextInput1);
Reset(TextInput2);
Reset(TextInput2_1);
Reset(TextInput2_2);
Reset(TextInput3);
Reset(TextInput4);
Notify("Thank you, your response has been submitted", NotificationType.Success);
Navigate(Screen2)

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

4 REPLIES 4
iAm_ManCat
Super User
Super User

Why are you doing ForAll(Collection and then not using the collection values and instead pointing to the TextInput and other controls? This implementation would cause one copy of that controls data to be created for every item in the collection.

Is the collection relevant? Did you want the collection values to be filled in the list?

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Hi No, it was the only way I found to update teh sharepoint list, if there is a better happy, happy to do that, the collection is not relevant, I tried to use just patch but wouldn't work

I think in this case you can just patch it with collecting the whole datasource into a collection, like this:

(apologies, my editor may have messed up the column names for the items containing apostrophes so you may need to clean up those)

 

Patch(
      'Innovation Survey',
    {
        'What are the biggest challenges you face when trying to implement Innovation/ Technologythe biggest ': TextInput3.Text,
        'Do you feel you have sufficient training & skills to successfully deliver the requirements of your role?': Dropdown2_1.SelectedText,
        'Is there any training/development you feel BGIS could provide in order to bridge those gaps?': Dropdown2_2.SelectedText,
        'do you know your client''s top 3-4 challenges are?': TextInput4.Text,
        'what involvement do you have in solving them?': Dropdown2_4.SelectedText,
        'if never - what is the reason?': TextInput1.Text,
        'Is there any technology you feel BGIS could implement/deploy to make your role easier?': TextInput2.Text,
        'what industry innovation have you seen that would benfit BGIS and it''s clients?': TextInput2_1.Text,
        'Have you brought forward an innovation for your account in the past?': If(Radio1.Selected.Value = "No", false, true),
        'Account Name': {
            Value: ComboBox1.Selected.Result,
            Id: LookUp('Locations and Contracts-fd5b7153-67d8-4fc6-9f1b-b846cf8fb4f4', 'Account Name' = ComboBox1.Selected.Result).ID
        }
    }
);
Reset(Dropdown1);
Reset(ComboBox1);
Reset(Dropdown1_2);
Reset(Dropdown1_3);
Reset(Dropdown2_1);
Reset(Dropdown2_2);
Reset(Dropdown2_2);
Reset(Dropdown2_4);
Reset(Radio1);
Reset(TextInput1);
Reset(TextInput2);
Reset(TextInput2_1);
Reset(TextInput2_2);
Reset(TextInput3);
Reset(TextInput4);
Notify("Thank you, your response has been submitted", NotificationType.Success);
Navigate(Screen2)

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


That has worked thank you very much 😊

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,360)