cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Corissandageri
Post Patron
Post Patron

Pen Input for Incident Report

I have a Diagram that I would like to draw where on a human body has suffered an injury. So when the form is submitted all the details of the incident, and the image would get saved too. Ideally when that report is recalled, I would like to see that same diagram and further edit the same image. I realise that when I save the pen input to Sharepoint that there will be no background image, but I was wondering what would be the best way of saving the Pen input to Sharepoint.

1 ACCEPTED SOLUTION

Accepted Solutions

I have my image background which has the outline of the body, then overlaid that is an image control which has the saved output image that comes from the Pen input PIInjury . Then on top of that is the Pen input control itself PIInjury, The Save  button has the following.

Set(varBlob,JSON(PIInjury.Image,IncludeBinaryData));SubmitForm(FormIncident)

 The image control which displays the save image has the following.

Substitute( ImageLink_DataCard3.Default,"""","")

So I can't re edit the same image but I can replace the original image.

Screenshot 2021-05-27 06.28.09.png

View solution in original post

12 REPLIES 12
WarrenBelz
Super User III
Super User III

Hi @Corissandageri ,

I have a blog on the various options of storing images in SharePoint. The one issue I can see however is that once you store an image, you cannot get it back and edit it.

Happy to elaborate further if you find one of these options suitable.

 

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.

Thanks Warren

I think I'll be checking out some other articles in your blog too.

Hi Warren

I have managed to save the PenInput to a Library and link it to my Sharepoint list. But I can't work out how to do it so that when I submit a form that it automatically submits the form and saves a single PenInput image with it. I have ditched the idea of re-editing the image when the record is recalled.

R3dKap
Super User
Super User

@Corissandageri,

Have you tried putting the code you created to save your PenInput inside the OnSuccess event of your form?

I never thought of that, but how do I make the flow write to the same record instead of a new one?

@Corissandageri ,

If you are saving to a Library, then you are obviously doing that with a Flow and you could run that on the form OnSuccess. I do mine the same way, except I use multi-line text fields in the list (hence not needing a Library or a Flow)

I using a Library, you also need to "link" the signature to the form record - I do this with photos by storing the ID of the "Master" record in a field in the Library (I call it IDRef) and you can get it from Self.LastSubmit.ID if running on the OnSuccess. One thing to watch however is to make signature input compulsory, or you will send over a blank signature. For this reason also, if the form is edited, you need to make the running conditional on there being something in the signature.

 

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.

 

 

Well I went down the road of a using a Flow, but I would prefer not to. So what would I have to change for a pen input re your article here?

@Corissandageri ,

I have never tried that one as the output of the camera control is different (it is stored in a format called dataUri ).

I was referring to this article (and I actually did one today) using a multi-line text field.

 

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.

R3dKap
Super User
Super User

@Corissandageri, personally I store camera photos or pen input signatures as real images inside a SharePoint library because then I can view them when I go to SharePoint (which is not the case if you store its binary data in a multi-line text field as @WarrenBelz describes). Not criticizing Warren's solution which works fine. Just saying I don't do it that way.

Meaning, that I do use a flow to store/update my pictures on SharePoint.

About saving images from Power Apps to SharePoint using a flow, I do it very simply this way:

  • on the Power Apps side, I call the flow:
SaveImage.Run(MasterRecord.ID, JSON(PenInput.Image, JSONFormat.IncludeBinaryData)
  • on the Power Automate flow side, I first create the file in the library using this code to set the file content (strSignature being the parameter retreiving the JSON value from Power Apps):
base64ToBinary(split(replace(variables('strSignature'),'"',''),',')[1])
  • then I update the properties of the newly created file to link it to my master list record

Note that in Power Apps, you will only be able to access the thumbnails for the images you stored in your library. You have access to 3 sizes of thumbnails though: small, medium, large.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (35,541)