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)
Solved! Go to Solution.
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! |
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! |
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! |
That has worked thank you very much 😊
User | Count |
---|---|
163 | |
95 | |
77 | |
72 | |
58 |
User | Count |
---|---|
216 | |
166 | |
97 | |
96 | |
74 |