Hello
How would I save my form to a collection instead of back to the original datasource?
I tried collect(exampleCollection,submitform(form1)); and it doesn't seem to work. Any other methods?
Hi @noneother ,
You cannot display an item from a collection on a form, however this will get you all the fields on the form that have been changed
ClearCollect(colForm,YourFormName.Updates)
Or you could simply code it all
ClearCollect(
colForm,
{
Field1Name:FormControl1.xxxx
Field2Name:FormControl2.xxxx
Field3Name:FormControl3.xxxx
}
)
the xxxx is what ever valid value refers to the control content.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
This doesn't seem to work for me, below. I want to simultaneously save to a collection then save that collection to the respective record within a SharePoint list. Any clues?
ClearCollect(ColForm1Form2,{Col_ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text, 'Activity Notes': DataCardValue25.Text});
ForAll(
ColForm1Form2,
Patch(
LookUp('Consumer Sample for Survey FINAL', Col_ACMPS_CARE_RECIPIENT_ID = ACMPS_CARE_RECIPIENT_ID),
{
'Activity Notes': ColForm1Form2[@'Activity Notes']
}
)
);
Nevermind. I saw I was missing: the source before Lookup
ClearCollect(ColForm1Form2,{ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text, 'Activity Notes': DataCardValue25.Text});
ForAll(
ColForm1Form2,
Patch(
'Consumer Sample for Survey FINAL', LookUp('Consumer Sample for Survey FINAL', ColForm1Form2[@ACMPS_CARE_RECIPIENT_ID] = ACMPS_CARE_RECIPIENT_ID),
{
'Activity Notes': ColForm1Form2[@'Activity Notes']
}
)
);
Hi @noneother ,
Are you waiting to also retain all the notes in the collection?
You need to firstly initiate it - App OnStart would work - this will give you an empty collection with the required fields
ClearCollect(
ColForm1Form2,
{'Consumer Sample for Survey FINAL':""|,
{'Activity Notes': ""}
);
Clear(ColForm1Form)
Then you can collect all the form inputs
Collect(
ColForm1Form2,
{
ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text,
'Activity Notes': DataCardValue25.Text
}
)
Then when you want to write it all back
ForAll(
RenameColumns(
ColForm1Form2,
"ACMPS_CARE_RECIPIENT_ID"
"ACMPS_ID"
"Activity Notes",
"Activity",
),
Patch(
'Consumer Sample for Survey FINAL',
{ACMPS_CARE_RECIPIENT_ID:ACMPS_ID};
{'Activity Notes':Activity]
)
)
Is this what you want to do - or do you want to write each, but store in a collection as well? The first bit (OnStart) and the collection would be the same. The Patch would be
Patch(
'Consumer Sample for Survey FINAL',
{ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text},
{'Activity Notes': DataCardValue25.Text}
)
or
UpdateIf(
'Consumer Sample for Survey FINAL',
ACMPS_CARE_RECIPIENT_ID=DataCardValue146.Text,
{'Activity Notes': DataCardValue25.Text}
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @noneother ,
It seems that you've solve your problem, am I right?
If so, do you have any other problem?
If not, could you change your issue's status to "Answered"?
Thanks!
Best regards,
User | Count |
---|---|
195 | |
123 | |
86 | |
48 | |
40 |
User | Count |
---|---|
281 | |
165 | |
139 | |
80 | |
76 |