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.
Nice app and nice use case! 👍
So everything is working fine or did you have any other question?
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.
@R3dKap ,
That is how I do my Photos (slight variation in the JSON conversion - I do the splitting in Power Apps).
I always use a PowerApps integrated form in my SharePoint lists, so I can view the signature in there.
@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:
SaveImage.Run(MasterRecord.ID, JSON(PenInput.Image, JSONFormat.IncludeBinaryData)
base64ToBinary(split(replace(variables('strSignature'),'"',''),',')[1])
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.
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.
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?
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.
I never thought of that, but how do I make the flow write to the same record instead of a new one?
Have you tried putting the code you created to save your PenInput inside the OnSuccess event of your form?
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.
WarrenBelz
146,653
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional