Skip to content

Integrate a Canvas App inside a Model-Driven App Form to create and edit a signature field.

Notifications You must be signed in to change notification settings

PowerPlatformPlace/Signatures-Capture-MDA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Signatures-Capture-MDA

Integrate a Canvas App inside a Model-Driven App Form to create and edit a signature field. USE CASE Integrate a Canvas App inside a Model-Driven App Form to create and edit a signature field.

TOOLS

Dataverse Model-Driven App Canvas App ModelDrivenFormIntegration Control

DESIGN

We have two Dataverse tables: Executives Accounts Table that will be used to create a Full name and ID for new Accounts. The other table is the Signatures table which will hold the Signature title and the signature value which is in base 64 format. The relationship between the two tables is 1 to N, where the Executives Account is the One side of the relationship and the Signatures table is the Many side of the relationship.

IMPLEMENTATION

  • Create the tables and the relationship.
  • Create the Form for the Executives' table
  • Create the Canvas App
  • Create the Model-Driven App
  • Add the Canvas App to the Executives Table Information Main Form

CODE

Get the MDA record id from the form where the Canvas App is Embeded

UpdateContext({lclVarHostMDAformId: GUID(First([@ModelDrivenFormIntegration].Data).ItemId)})

Capture the Signature in base64 format from the PenInput control

Set(
    sig64,
    Substitute(
        JSON(
            PenInput1_1.Image,
            IncludeBinaryData
        ),
        """",
        ""
    )
)

Create New Signature

Patch(
        Signatures,
        Defaults(Signatures),
        {
            'EID - EXC Account': LookUp(
                'EXC Accounts',
                'EXC Accounts' = lclVarHostMDAformId
            ),
            'Signatures Field': sig64,
            'Sig Name': txtNewTitle.Text
        }
    )
   ;
    ModelDrivenFormIntegration.RefreshForm(true)

Update Existing Signature

UpdateIf(
            Signatures,
            'Sig Name' = GallerySigs.Selected.'Sig Name',
            {
                'Signatures Field': sig64,
                'Sig Name': TextInput1.Text
            }
        )
       ;
       ModelDrivenFormIntegration.RefreshForm(true)

About

Integrate a Canvas App inside a Model-Driven App Form to create and edit a signature field.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors