Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Pen Input for Incident Report

(0) ShareShare
ReportReport
Posted on by 725

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.

  • R3dKap Profile Picture
    1,594 on at
    Re: Pen Input for Incident Report

    Nice app and nice use case! 👍

    So everything is working fine or did you have any other question?

  • Verified answer
    R Bakker Profile Picture
    725 on at
    Re: Pen Input for Incident Report

    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

  • WarrenBelz Profile Picture
    146,653 Most Valuable Professional on at
    Re: Pen Input for Incident Report

    @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.

  • R3dKap Profile Picture
    1,594 on at
    Re: Pen Input for Incident Report

    @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.

  • WarrenBelz Profile Picture
    146,653 Most Valuable Professional on at
    Re: Pen Input for Incident Report

    @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.

  • R Bakker Profile Picture
    725 on at
    Re: Pen Input for Incident Report

    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?

  • WarrenBelz Profile Picture
    146,653 Most Valuable Professional on at
    Re: Pen Input for Incident Report

    @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.

     

     

  • R Bakker Profile Picture
    725 on at
    Re: Pen Input for Incident Report

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

  • R3dKap Profile Picture
    1,594 on at
    Re: Pen Input for Incident Report

    @Corissandageri,

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

  • R Bakker Profile Picture
    725 on at
    Re: Pen Input for Incident Report

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,653 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard