cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ajilakes
Level: Powered On

Capture Image and Save as Attachment

Hi @RezaDorrani 

 

I am having an issue trying to send that attachment once it gets created into the Datacard.

 

When I click on the image it creates a link for the image in the attachments data card. The only issue with this is when I try to submit, it gives me an error saying, "entry is required or has an invalid value. please correct and try again." 

 

It won't submit the attachment of the camera control image, but if I click on attach a file, it goes straight to a folder to select a file and that file will allow me to submit. The issue seems like it has to do with the collection.

 

Would you be able to help me with this one more thing? 

(Attachment shows the error)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Capture Image and Save as Attachment

Hi @Ajilakes ,

Do you want to upload the picture captured via Camera control into the Attachments control, and then submit the form data?

 

If you want to upload the picture captured via Camera control into the Attachments control, and then submit the form data, I afraid that there is no way to achieve your needs in PowerApps currently. In addition, the Patch fucntion in PowerApps could not also achieve your needs.

 

As an alternative solution, I think the combination of PowerApps and MS Flow could achieve your needs (fire a flow from your app, and pass the captured camera picture data). Within the Edit form of your app, your need to disable the "Attachments" field data card firstly.

I have maded a test on my side, please take a try with the following workaround:

Flow's configuration as below:8.JPG

 

App's configuration as below:6.JPG

 

7.JPG

 

9.JPG

Set the OnSelect proeprty of the Camera control to following formula:

ClearCollect(ImageData, {Name: "Camera1.jpg", Content: Camera1.Photo})

Set the OnSuccess property of the Edit form (Edit form1) to following:

CaptureCameraImagetoSPList.Run(JSON(ImageData, JSONFormat.IncludeBinaryData), EditForm1.LastSubmit.ID);   /* <-- Within 'FlowName'.Run() formula, specify values for the two arguments specified in your flow */
Back()

More details about firing a flow from an app, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

https://www.youtube.com/watch?v=1wl9AtxWdkg

 

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

6 REPLIES 6
Dual Super User
Dual Super User

Re: Capture Image and Save as Attachment

Hi @Ajilakes 

 

I will test this use case

 

Dual Super User
Dual Super User

Re: Capture Image and Save as Attachment

@Ajilakes 

 

Got this to work using Patch command after submit form (that is the only way to achieve it) or use MS Flow

The Patch commnad scenario is complicated and I would have to do a video blog on it to explain the use case

I will plan to do it sometime mid next week 

 

 

Ajilakes
Level: Powered On

Re: Capture Image and Save as Attachment

Thanks Reza,

 

I will wait for the video next week to fix this issue with my powerapps. 

Dual Super User
Dual Super User

Re: Capture Image and Save as Attachment

@Ajilakes 

 

FYI - It is a hack 🙂

Community Support Team
Community Support Team

Re: Capture Image and Save as Attachment

Hi @Ajilakes ,

Do you want to upload the picture captured via Camera control into the Attachments control, and then submit the form data?

 

If you want to upload the picture captured via Camera control into the Attachments control, and then submit the form data, I afraid that there is no way to achieve your needs in PowerApps currently. In addition, the Patch fucntion in PowerApps could not also achieve your needs.

 

As an alternative solution, I think the combination of PowerApps and MS Flow could achieve your needs (fire a flow from your app, and pass the captured camera picture data). Within the Edit form of your app, your need to disable the "Attachments" field data card firstly.

I have maded a test on my side, please take a try with the following workaround:

Flow's configuration as below:8.JPG

 

App's configuration as below:6.JPG

 

7.JPG

 

9.JPG

Set the OnSelect proeprty of the Camera control to following formula:

ClearCollect(ImageData, {Name: "Camera1.jpg", Content: Camera1.Photo})

Set the OnSuccess property of the Edit form (Edit form1) to following:

CaptureCameraImagetoSPList.Run(JSON(ImageData, JSONFormat.IncludeBinaryData), EditForm1.LastSubmit.ID);   /* <-- Within 'FlowName'.Run() formula, specify values for the two arguments specified in your flow */
Back()

More details about firing a flow from an app, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

https://www.youtube.com/watch?v=1wl9AtxWdkg

 

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

Ajilakes
Level: Powered On

Re: Capture Image and Save as Attachment

All I can say @v-xida-msft , 

 

You are a savior lol!! I needed that exact example and it helped me get the picture submitted with the form at the same time. Thanks for all the help, greatly appreciate it!!!

 

Best,

Alexander Lagos

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,072)