Hello,
I am pretty new to powerapps and i am stuck on a requirement that seems pretty straightforward.
I have a sharepoint list that is populated by collected survey details. On my reviewer powerapp end, i get to fetch each survey detail for further analysis and classification.
All this analysis and classification is done on the edit form section. My problem is, i don't want to replace the original survey details on my sharepoint list A with these edits and classification, but would like these changes to be created as a new item (something like a child item with reference to original survey item) on a new sharepoint list so as not to lose the original submitted survey details. This is because the end users powerapp should only be able to see the edited and classified survey details. I tried creating a new sharepoint list with exact fields like the original sharepoint list, with an extra ID field (ParentID) that is similar to the original survey record ID. This list is to be populated every time the SubmitForm button is clicked on the edit form using Patch function. This worked well, but unfortunately i got stuck on records that have attachments. I can't seem to be able to populate my attachment field on my second list using the patch function in case a reviewer decides to add another attachment to a survey. Kindly advice on what to do. And if there is any other easier way of doing this than what i am currently trying to do. I can't seem to wrap my head around the parent-child relationship situation which i suspect is the right way to implement this.
Currently this is what i have on my onSelect property on my Submit button on the EditForm. 'ACRPE Topic Message Details' is the name of my second sharepoint list.
SubmitForm(EditForm1);
Refresh('ACRPE Topic Message Details');
Patch(
'ACRPE Topic Message Details',
Defaults('ACRPE Topic Message Details'),
{
ParentID: BrowseGallery2.Selected.ID,
'Message Reviewed By': BrowseGallery2.Selected.'First Reviewer',
Topic: BrowseGallery2.Selected.Topic,
'Message Classification': BrowseGallery2.Selected.'Message Classification'.Value,
'Enriched Message': BrowseGallery2.Selected.'Enriched Message',
Attachments: BrowseGallery2.Selected.Attachments
}
);
Solved! Go to Solution.
Hi @afara ,
Do you mean that you have trouble in updating attachments by using patch function?
The reason why you met this problem is that it's not supported to use patch function in attachments.
Attachments only supported in form and being updated by submitform function.
I suggest you: insert another form only for attachments field, not choose other fields in this form.
Firstly using patch to create a new record with other fields, then use the new form to update this created item's attachments.
Try this formula:
SubmitForm(EditForm1);
Refresh('ACRPE Topic Message Details');
Patch(
'ACRPE Topic Message Details',
Defaults('ACRPE Topic Message Details'),
{
ParentID: BrowseGallery2.Selected.ID,
'Message Reviewed By': BrowseGallery2.Selected.'First Reviewer',
Topic: BrowseGallery2.Selected.Topic,
'Message Classification': BrowseGallery2.Selected.'Message Classification'.Value,
'Enriched Message': BrowseGallery2.Selected.'Enriched Message',
}
);
SubmitForm(newforname)
//please replace with your new form's name
set the new form's Item:
Last('ACRPE Topic Message Details')
//the item that was created just now
Best regards,
Hi @afara ,
Do you mean that you have trouble in updating attachments by using patch function?
The reason why you met this problem is that it's not supported to use patch function in attachments.
Attachments only supported in form and being updated by submitform function.
I suggest you: insert another form only for attachments field, not choose other fields in this form.
Firstly using patch to create a new record with other fields, then use the new form to update this created item's attachments.
Try this formula:
SubmitForm(EditForm1);
Refresh('ACRPE Topic Message Details');
Patch(
'ACRPE Topic Message Details',
Defaults('ACRPE Topic Message Details'),
{
ParentID: BrowseGallery2.Selected.ID,
'Message Reviewed By': BrowseGallery2.Selected.'First Reviewer',
Topic: BrowseGallery2.Selected.Topic,
'Message Classification': BrowseGallery2.Selected.'Message Classification'.Value,
'Enriched Message': BrowseGallery2.Selected.'Enriched Message',
}
);
SubmitForm(newforname)
//please replace with your new form's name
set the new form's Item:
Last('ACRPE Topic Message Details')
//the item that was created just now
Best regards,
User | Count |
---|---|
124 | |
87 | |
87 | |
75 | |
69 |
User | Count |
---|---|
215 | |
181 | |
140 | |
97 | |
83 |