cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Can't clear collection

Hi, I can't seem to clear the collection from my APP. I have a camera (MyCamera) in my APP which is used to capture images and the images will then be updated to my collection (MyPicture) as I would like the users to view the captured images before submitting the form. When the users submit the form, the image captured by the previous user is supposed to reset but it doesn't seem to work that way. The image will not be seen in my APP but when I submit my form, the image will appear in SharePoint instead. Can anyone help me with this?

 

This is my code for the 'Submit' button:

Patch('New Input', Defaults('New Input'), {'Defects/Abnormalities 缺陷描述:': DataCardValue9.Text, 'Date Found 发现日期:': DataCardValue10.SelectedDate, 'Observed By 由谁发现:': DataCardValue11.Selected, 'Department:': DataCardValue12.Selected, 'Cell & Line Structure (PMD):': DataCardValue13.Selected, 'Cell & Line Structure (SMD):': DataCardValue14.Selected, 'Cell & Line Structure (FMD):': DataCardValue15.Selected, 'Module (PMD):': DataCardValue16.Selected, 'Module (SMD Cell 1 Line A):': DataCardValue32.Selected, 'Module (SMD Cell 1 Line B):': DataCardValue33.Selected, 'Module (SMD Cell 2 Line A):': DataCardValue34.Selected, 'Module (SMD Cell 2 Line B):': DataCardValue35.Selected, 'Module (FMD):': DataCardValue36.Selected, 'Type of Defect 缺陷种类:': DataCardValue37.Selected, 'Defect Priority 缺陷等级:': DataCardValue38.Selected, 'Root Cause 发生原因:': DataCardValue39.Text, 'Status of Defect 缺陷状态:': DataCardValue40.Selected, 'Images:': MyCamera.Photo}); Navigate('Home Page', ScreenTransition.None);  Reset(DataCardValue9); Reset(DataCardValue10); Reset(DataCardValue11); Reset(DataCardValue12); Reset(DataCardValue13); Reset(DataCardValue14); Reset(DataCardValue15); Reset(DataCardValue16); Reset(DataCardValue32); Reset(DataCardValue33); Reset(DataCardValue34); Reset(DataCardValue35); Reset(DataCardValue36); Reset(DataCardValue37); Reset(DataCardValue38); Reset(DataCardValue39); Reset(DataCardValue40); Clear(MyPicture)
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Can't clear collection

Hi @Anonymous ,

Could you please share a bit more about your issue?

Do you mean that the Collection (MyPicture) could not be cleared using Clear() function within your app?

I have made a test on my side, and don't have the issue that you mentioned. The Clear() function works well within my app.

 

Based on the formula that you provided, I find that you reference the captured picture via MyCamera.Photo formula within your Patch formula rather than image values from your MyPicture collection. Please consider take a try to reset your Camera control within your app, check if the issue is solved.

On your side, please modify your formula as below:

Patch('New Input', Defaults('New Input'), {'Defects/Abnormalities 缺陷描述:': DataCardValue9.Text, 'Date Found 发现日期:': DataCardValue10.SelectedDate, 'Observed By 由谁发现:': DataCardValue11.Selected, 'Department:': DataCardValue12.Selected, 'Cell & Line Structure (PMD):': DataCardValue13.Selected, 'Cell & Line Structure (SMD):': DataCardValue14.Selected, 'Cell & Line Structure (FMD):': DataCardValue15.Selected, 'Module (PMD):': DataCardValue16.Selected, 'Module (SMD Cell 1 Line A):': DataCardValue32.Selected, 'Module (SMD Cell 1 Line B):': DataCardValue33.Selected, 'Module (SMD Cell 2 Line A):': DataCardValue34.Selected, 'Module (SMD Cell 2 Line B):': DataCardValue35.Selected, 'Module (FMD):': DataCardValue36.Selected, 'Type of Defect 缺陷种类:': DataCardValue37.Selected, 'Defect Priority 缺陷等级:': DataCardValue38.Selected, 'Root Cause 发生原因:': DataCardValue39.Text, 'Status of Defect 缺陷状态:': DataCardValue40.Selected, 'Images:': MyCamera.Photo}); 
Navigate('Home Page', ScreenTransition.None);
Reset(DataCardValue9);
Reset(DataCardValue10);
Reset(DataCardValue11);
Reset(DataCardValue12);
Reset(DataCardValue13);
Reset(DataCardValue14);
Reset(DataCardValue15);
Reset(DataCardValue16);
Reset(DataCardValue32);
Reset(DataCardValue33);
Reset(DataCardValue34);
Reset(DataCardValue35);
Reset(DataCardValue36);
Reset(DataCardValue37);
Reset(DataCardValue38);
Reset(DataCardValue39);
Reset(DataCardValue40);
Clear(MyPicture);
Reset(MyCamera); /* <-- Add this formula */

 

In addition, if the issue still exists, please consider take a try to reference the captured picture from your MyPicture collection instead of MyCamera.Photo formula. On your side, you should modify your formula as below:

Patch(
'New Input',
Defaults('New Input'),
{
'Defects/Abnormalities 缺陷描述:': DataCardValue9.Text,
'Date Found 发现日期:': DataCardValue10.SelectedDate,
'Observed By 由谁发现:': DataCardValue11.Selected,
'Department:': DataCardValue12.Selected,
'Cell & Line Structure (PMD):': DataCardValue13.Selected,
'Cell & Line Structure (SMD):': DataCardValue14.Selected,
...,
'Status of Defect 缺陷状态:': DataCardValue40.Selected,
'Images:': First(MyPicture).Url /* <-- Modify formula here , MyPicture represents your MyPicture collection */
}
); Navigate('Home Page', ScreenTransition.None); Reset(DataCardValue9); Reset(DataCardValue10); Reset(DataCardValue11); ... Reset(DataCardValue40); Clear(MyPicture)

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Can't clear collection

Hi @Anonymous ,

Could you please share a bit more about your issue?

Do you mean that the Collection (MyPicture) could not be cleared using Clear() function within your app?

I have made a test on my side, and don't have the issue that you mentioned. The Clear() function works well within my app.

 

Based on the formula that you provided, I find that you reference the captured picture via MyCamera.Photo formula within your Patch formula rather than image values from your MyPicture collection. Please consider take a try to reset your Camera control within your app, check if the issue is solved.

On your side, please modify your formula as below:

Patch('New Input', Defaults('New Input'), {'Defects/Abnormalities 缺陷描述:': DataCardValue9.Text, 'Date Found 发现日期:': DataCardValue10.SelectedDate, 'Observed By 由谁发现:': DataCardValue11.Selected, 'Department:': DataCardValue12.Selected, 'Cell & Line Structure (PMD):': DataCardValue13.Selected, 'Cell & Line Structure (SMD):': DataCardValue14.Selected, 'Cell & Line Structure (FMD):': DataCardValue15.Selected, 'Module (PMD):': DataCardValue16.Selected, 'Module (SMD Cell 1 Line A):': DataCardValue32.Selected, 'Module (SMD Cell 1 Line B):': DataCardValue33.Selected, 'Module (SMD Cell 2 Line A):': DataCardValue34.Selected, 'Module (SMD Cell 2 Line B):': DataCardValue35.Selected, 'Module (FMD):': DataCardValue36.Selected, 'Type of Defect 缺陷种类:': DataCardValue37.Selected, 'Defect Priority 缺陷等级:': DataCardValue38.Selected, 'Root Cause 发生原因:': DataCardValue39.Text, 'Status of Defect 缺陷状态:': DataCardValue40.Selected, 'Images:': MyCamera.Photo}); 
Navigate('Home Page', ScreenTransition.None);
Reset(DataCardValue9);
Reset(DataCardValue10);
Reset(DataCardValue11);
Reset(DataCardValue12);
Reset(DataCardValue13);
Reset(DataCardValue14);
Reset(DataCardValue15);
Reset(DataCardValue16);
Reset(DataCardValue32);
Reset(DataCardValue33);
Reset(DataCardValue34);
Reset(DataCardValue35);
Reset(DataCardValue36);
Reset(DataCardValue37);
Reset(DataCardValue38);
Reset(DataCardValue39);
Reset(DataCardValue40);
Clear(MyPicture);
Reset(MyCamera); /* <-- Add this formula */

 

In addition, if the issue still exists, please consider take a try to reference the captured picture from your MyPicture collection instead of MyCamera.Photo formula. On your side, you should modify your formula as below:

Patch(
'New Input',
Defaults('New Input'),
{
'Defects/Abnormalities 缺陷描述:': DataCardValue9.Text,
'Date Found 发现日期:': DataCardValue10.SelectedDate,
'Observed By 由谁发现:': DataCardValue11.Selected,
'Department:': DataCardValue12.Selected,
'Cell & Line Structure (PMD):': DataCardValue13.Selected,
'Cell & Line Structure (SMD):': DataCardValue14.Selected,
...,
'Status of Defect 缺陷状态:': DataCardValue40.Selected,
'Images:': First(MyPicture).Url /* <-- Modify formula here , MyPicture represents your MyPicture collection */
}
); Navigate('Home Page', ScreenTransition.None); Reset(DataCardValue9); Reset(DataCardValue10); Reset(DataCardValue11); ... Reset(DataCardValue40); Clear(MyPicture)

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Can't clear collection

Hi, sorry for the late reply as I didn't receive any notification in my E-Mail.

 

Thank you very much!! Your second solution solved my issue!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,331)