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

Including image data in submitform

I have a form for recording new entries on a Petty Case Sharepoint list. The form contains a few datacards (which work fine) and I am trying to include a camera option to take a photo of the receipt (which isn't working).

I had been using SubmitForm with just the text and number datacards, but have hit a bit of wall when trying to include an ImageData dadatcard or using the attachment facility.

I've experimented with a few options I have found online and have managed to get the camera on its own to work on a test screen using: Patch(BH_PettyCash,Defaults(BH_PettyCash),{'Description (Title)':TextInput2.Text,ImageData:First(cmrImg).Url})  **This employs a text box which is not required in my form, but again I'm not sure how to remove this from the formula.

I have also adjusted the Sharepoint list so that clicking on Title brings up the photo as well in the edit screen, so any soultion hopefully won't change this.

So my question is: how do I include the image taken by the camera in the SubmitForm (or Patch)?

1 ACCEPTED SOLUTION

Accepted Solutions
KevinHardy
Level: Powered On

Re: Including image data in submitform

Thanks for everbodys help which has helped me sort this out and understand DataCards more.

After much experimentation I found a solution that worked: I included the DataImage as a field of the DataCard and then added the Camera function and an Image box to the DataCard. Then I made the DataCardValue equal Camera1.Photo. Whenthe form was submitted it saved all the fields, including the DataImage information. Problem appears solved 🙂

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Including image data in submitform

Hi @KevinHardy ,

 

Are you trying to upload the captured image to a Picture column or as the attachment of an item?

 

If it's the former, I afraid that there is no direct way to achieve your needs in PowerApps currently.

As an alternative solution, you could consider take a try to pass the captured pictures (using Camera control) to a flow, then use the flow to create an attachments to corresponding SP list item. Please check and see if the following blog would help in your scenario:3.JPG

Please check and see if the following blog would help in your scenario:

https://www.techmikael.com/2017/05/an-even-more-clever-workaround-for.html

 

If it's the latter, then I think the only way to add attachments to SharePoint list item is using Attachments control.

More details about uploading images using Attachments control, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/add-attachments-to-sharepoint-lists/

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
KevinHardy
Level: Powered On

Re: Including image data in submitform

@

Thank you for your reply.

I've attached a screen shot of the Sharepoint list I've set up and the app screen I would like to use.

I've copied the url into the ImageData column of the Sahrepoint list to test that the image comes up when you edit the line, which it does (as we will need this for auditting purposes).

As I said I have been able to upload the photo url to the ImageData column (which is multiline text) using the Patch function in isolation on a test screen which I found in a very helpful YouTube video.

I have also seen in the Budget Tracker template that it is possible to use the camera like this, but in that template the camera is again on a separate screen which I would rather not do if avoidable.

If absolutely necessary I could move the capturing of the receipt image to another page, but how would I ensure that the ImageData went to the same line that SubmitForm had populated on the 'Add New Item' page?

Lars4
Level: Powered On

Re: Including image data in submitform

Did you try to add a "AddPicture" Control to the Datacard of your image column? Then you can take a photo and the BlobStorage address is saved in this text column. 

 

However, If you want to stay with taking a photo on another screen, you could store its Base64 in a global variable and set this global variable as Default Value of the image column in your form. This way you ensure, that the photo comes to the right line. 

 

(I prefer the second scenario. And if you have some place left on the screen with the form, you can also do it on the same screen - or you can scroll as well) 

KevinHardy
Level: Powered On

Re: Including image data in submitform

Thanks for everbodys help which has helped me sort this out and understand DataCards more.

After much experimentation I found a solution that worked: I included the DataImage as a field of the DataCard and then added the Camera function and an Image box to the DataCard. Then I made the DataCardValue equal Camera1.Photo. Whenthe form was submitted it saved all the fields, including the DataImage information. Problem appears solved 🙂

View solution in original post

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
Users Online
Currently online: 445 members 6,011 guests
Please welcome our newest community members: