146
Views
8
Comments
[Signature Pad] How to save a signature to database
Question
signature-pad
Reactive icon
Forge asset by Labs
Application Type
Mobile

Hello,

I have the Signature Pad plugin for mobile. However i could not manage to save the signature to the database, when clicked on "Afronden". How can i achieve this? The signature needs to be saved on certain forms specific. For exmaple a open a filled in form, i do a signature and click on "Afronden", and when i later open this form, it needs to show the signature.

2018-10-29 08-31-03
João Marques
 
MVP

Hi Samed,


Have you checked the Signature Pad Demo component?

It seems to demo how to do what you are looking for:


Hope it helps.


Regards,
João

UserImage.jpg
Samed Gurses

Hello @João, i tried the demo, but there are many missing and incompatible dependencies, so i could not test en try it the good way. I tried some of the implementation but did not come out. Do you maybe have an step by step explanation?

2018-10-29 08-31-03
João Marques
 
MVP

Hi Samed,


See the attached OML without the dependencies.

In a nutshell, the signatures are saved in the Signature entity:

And you have two blocks, one to capture the signature and store it in the database (when it is saved it will trigger the SignatureUpdate event with the Signature Id updated) and the block to display the signature from the database (you just need to pass the Signature Id as a parameter).

Hope it helps.


Regards,
João

SignaturePadDemo.oml
UserImage.jpg
Samed Gurses

Hello @joao, i tried everything, but it does not save it to the Signature entity. I really dont know what i do wrong. Please have a look at the images below. I also see the next notification: I fixed this problem now, but still nothing saves to the DB. Do you need images to see the problem?


all the other actions etc, i did not changed anything to them, so thats why i dont understand why it is not working. Also the notification above, i do not know why it shows that.



2018-10-29 08-31-03
João Marques
 
MVP

Hi Samed,


I installed it on my phone and it saves it in the database and it displays correctly.

Have you generated a new version of the app and reinstall it in your phone to test it?

Can you share your OML to check what is going on?



UserImage.jpg
Samed Gurses

Here you go, the "Button" leads you to the signature 

Signature.oml
2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Hello Samed,

I've edited your post to include the Signature Pad forge component - I assume this is the one you're using in order to implement this. This way, the forge component creators will have visibility of your question and you'll get better answers. If I got the component wrong, please let me know and I'll fix it.

Regarding your question, I took a look at the component documentation and it appears to return Binary Data once a signature is complete. You'd need a Binary Data column in one of your Entities in order to save this data.

I assume "Afronden" is your Submit action to complete your form? What I would imagine you can do is have a local variable of the Binary Data type, and fill it on the SignaturePadDone event. Then, when the user clicks "Afronden", you'd read this local variable and save it to your database. Looking at the webblock inputs, I don't think this component is capable of showing previous signatures. So you'd have to use an Image element in order to show your Binary Data afterwards.

UserImage.jpg
Samed Gurses

Hi @Afonso Carvalho ,


Since i am new to this, i actually do now quit know how and where to start. And yes my "Afronden" is the Submit button. Like where do i have to make the local variable? 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.