web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help adding signature ...
Power Apps
Unanswered

Help adding signature from PenInput to Sharepoint list as attachment.

(0) ShareShare
ReportReport
Posted on by 60

Hi Everyone,

 

I have followed these instructions precisely and I cant seem to get this to work.

https://www.youtube.com/watch?v=AIJ6lD8H1WM

 

I receive an error on my flow - 

InvalidTemplate. Unable to process template language expressions in action 'Add_attachment' inputs at line '0' and column '0': 'The template language function 'base64ToBinary' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'.

 

SubmitForm(EditForm1);

Sign_to_Sharepoint.Run(ID,DCOrderNo.Text,
Mid(JSON(PenInput3_1.Image,JSONFormat.IncludeBinaryData),Find
(",",JSON(PenInput3_1.Image,JSONFormat.IncludeBinaryData))+1,Len(JSON(PenInput3_1.Image,JSONFormat.IncludeBinaryData))-Find(",",JSON(PenInput3_1.Image,JSONFormat.IncludeBinaryData))-1))

 

Can anyone assist me with where I may be going wrong?

 

Or

 

Suggest a better way to have someone sign a Pen input and then attach to a SharePoint list. 

Categories:
  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Lutzy ,

    You can cut that down a bit to this, but your issue will be in the Flow which you have not posted

    With(
     {
     wJSON: 
     JSON(
     PenInput3_1.Image,
     JSONFormat.IncludeBinaryData
     )
     },
     Sign_to_Sharepoint.Run(
     ID,
     DCOrderNo.Text,
     Mid(
     wJSON,
     Find(
     ",",
     wJSON
     ) + 1,
     Len(wJSON) - 
     Find(
     ",",
     wJSON
     ) - 1
     )
     )
    )
  • Lutzy Profile Picture
    60 on at

    Thanks @WarrenBelz ,

     

    I tried your suggestion and got the same error.

    SubmitForm(EditForm1_1); With( { wJSON: JSON( PenInput3_1.Image, JSONFormat.IncludeBinaryData ) }, Sign_to_Sharepoint.Run(DCID, DCOrderNo.Text, Mid( wJSON, Find( ",", wJSON ) + 1, Len(wJSON) - Find( ",", wJSON ) - 1 ) ) )

     

    Error

    Unable to process template language expressions in action 'Add_attachment' inputs at line '0' and column '0': 'The template language function 'base64ToBinary' expects one parameter: the string to decode from base64 representation. The function was invoked with '0' parameters. Please see https://aka.ms/logicexpressions#base64ToBinary for usage details.'.

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Lutzy ,
    As I noted, your issue with be a mis-match between what you have sent to the Flow and what it expects. You have not posted the Flow - it should be something like this

    WarrenBelz_0-1689122940630.png

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Lutzy Profile Picture
    60 on at

    I appreciate your help warren.  Here is the flow attached.  I am sure I have followed the video instructions exactly and the flow is pretty simple.  

    Lutzy_1-1689123119976.png

     

     

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Lutzy ,

    I actually updated my post just after I did it (please refer to the flow. I have just run it from this test app

    WarrenBelz_0-1689124284348.png

    with this code (I used 1 for the ID just to test)

    WarrenBelz_1-1689124307271.png

    and have a file with the pen image attached

    WarrenBelz_2-1689124357865.png

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

  • Lutzy Profile Picture
    60 on at

    Awesome, I think I am almost there.  If I specify an ID number as you have that already exists it works. So thanks for that.

     

    However I am working with a new form and I have placed the Submitform at the beginning.   

     

    I assume it creates the ID upon submit before the flow starts so it should work.  

     

    How do I still map the ID to the ID that is created when the form is submitted?

     

    Apologies if that is a basic question but I am still getting my head around how it works.

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    Hi @Lutzy ,

    The only way you will do this with a new record is put the code OnSuccess of the Form and send

    Self.LastSubmit.ID

    as the parameter.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Lutzy Profile Picture
    60 on at

    Hi @WarrenBelz ,  Sorry to bother you again.  I am still having issues with this.  If I specify an ID number it will work.  I cant seem to get this to work any other way and I have tried a number of different options.  

    Lutzy_0-1689190838714.png

     

    The fact that it works when I specify a number says that I am passing the right information.  It is just struggling with the ID.

     

     

    The error I am getting is -

    Lutzy_1-1689190979775.png

     

    this issue only occurs on a new form.  When I edit an existing record the flow runs successfully and the image is saved to the Sharepoint list. (Image is blank but this might be a different issue.  At least the flow works on an existing record. )

      

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Lutzy ,

    Self.LastSubmit.ID works on a new record - I use it in many places when I want to create "child" record references at the same time a new "parent" is created. If you create a new record and put this on a label

    YourFormName.LastSubmit.ID

    do you see the expected ID number ?

  • Lutzy Profile Picture
    60 on at

    @WarrenBelz   Yeah, I definitely see the expected number.  I'm feeling a little deflated now.

    Here is what I have for the new docket.  I decided to send to a new screen to capture the signature.

    You can see that the Editform1_1.LastSubmitVariable.ID is displaying the correct ID -

    Lutzy_0-1689205912627.png

     

    Existing Docket that works.  I have the PenInput on the same page and references the ID from the Datacard and on  OnSuccess of the form.  This attached the file to the Sharepoint list successfully.

    Lutzy_1-1689206149845.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard