SteveG | Posts: 3

Condition logic on Signature capture with text tags

0 votes

I have made a template the first signature capture mandatory for each signer and subsequently made the rest optional with conditional logic. This setup ensures that the mandatory capture becomes optional once any of the others are signed.

a_4.png

b_4.png

In our setup, we utilize text tags alongside the Java OneSpan SDK. I've observed that the SDK provides the necessary conditions that I'll need to create.

Example text tags for one Signer  

{{esl:Signer1:capture}}

{{?esl:Signer1:capture}}

{{?esl:Signer1:capture}}

It appears that the conditional logic relies on the ID of the capture field, but I'm unable to discern how to retrieve it from within the package object. The fields within the signature objects are listed as empty.

c_4.png

I was considering whether I could create the package initially as a draft, and then obtain the list of capture field IDs to which I could add conditions. Is it possible to assign an ID to a text tag and then create the conditions upon package creation using the .withConditions property?
d_4.png


Attachments
a_4.png142.46 KB
b_4.png29.46 KB
c_4.png11.41 KB
d_4.png19.98 KB
Gabriel.Cloutier | Posts: 20

Reply to: Condition logic on Signature capture with text tags

0 votes

Hi Steve,

To add conditions to a text tag, you will need to use a two step approach. First, you'll want to create the transaction. Second, you'll want to find the text tags in the transaction and add the conditions to them. You will then be able to update the transaction and the conditions will be added to the text tags.

Here is a codeshare with an example of what you want to do: https://community.onespan.com/documentation/codeshare/position-extraction-conditional-fields
 

If you have any questions don't hesitate to ask!


SteveG | Posts: 3

Reply to: Condition logic on Signature capture with text tags

0 votes

Thanks Gabriel.Cloutier the doc is helpful but I am not trying to set a condition on a checkbox or textbox. I am trying to update the condition on an actual signature capture field. However the field id of them don't seem to be available via code.

This is condition I am try to set  

.withCondition("document['" + document.getId().getId() + "'].approval['" + signature.getId().toString() + "'].accepted == true")
.withAction("document['" + document.getId().getId() + "'].field['" + signatureCaptureField + "'].required = false")
.build();

I can't seem to figure out how to get the  signatureCaptureField value in the API for the action part of then condition.  if I look at the fields they are a empty list 

 

 

If I make a test template then look at via the API the condition looks like mine.

 But Then when I view the test template document vai the API I can see how to get value 4lZGeZwQzaEJ for  field['4lZGeZwQzaEJ'].required 

As seen below I outputted all signature from the test template none have fields associated with them nor dose  4lZGeZwQzaEJ value match any signature ID. 

result = {ArrayList@52792}  size = 9
0 = {Signature@52800} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52810} "bhWSs6uFJvgT"
 roleId = null
 page = 0
 x = 105.0
 y = 741.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52812}  size = 0
 name = ""
 extraction = false
 textAnchor = null
 optional = false
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
1 = {Signature@52801} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52815} "Z2e1dS6yu607"
 roleId = null
 page = 0
 x = 105.0
 y = 795.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52816}  size = 0
 name = ""
 extraction = false
 textAnchor = null
 optional = true
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
2 = {Signature@52802} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52819} "AR7UWCeszYoU"
 roleId = null
 page = 0
 x = 104.0
 y = 853.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52820}  size = 0
 name = ""
 extraction = false
 textAnchor = null
 optional = true
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
3 = {Signature@52803} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52834} "QIzNDIGpjVU3"
 roleId = null
 page = 0
 x = 308.0
 y = 741.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52835}  size = 0
 name = "field1"
 extraction = false
 textAnchor = null
 optional = false
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
4 = {Signature@52804} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52839} "7TO3DDZIUEIW"
 roleId = null
 page = 0
 x = 307.0
 y = 795.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52840}  size = 0
 name = "field2"
 extraction = false
 textAnchor = null
 optional = true
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
5 = {Signature@52805} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52844} "XViUJScS2pI1"
 roleId = null
 page = 0
 x = 301.0
 y = 852.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52845}  size = 0
 name = "field3"
 extraction = false
 textAnchor = null
 optional = true
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
6 = {Signature@52806} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52850} "o1Ylxzn4U54S"
 roleId = null
 page = 0
 x = 505.0
 y = 735.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52851}  size = 0
 name = ""
 extraction = false
 textAnchor = null
 optional = false
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
7 = {Signature@52807} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52854} "i2E8zq7unMsD"
 roleId = null
 page = 0
 x = 506.0
 y = 795.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52855}  size = 0
 name = ""
 extraction = false
 textAnchor = null
 optional = true
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""
8 = {Signature@52808} 
 signerEmail = "[email protected]"
 accepted = null
 signatureId = {SignatureId@52858} "QAEr7E2jER0A"
 roleId = null
 page = 0
 x = 508.0
 y = 848.0
 style = {SignatureStyle@52811} "FULL_NAME"
 width = 165.0
 height = 37.0
 fontSize = null
 fields = {ArrayList@52859}  size = 0
 name = ""
 extraction = false
 textAnchor = null
 optional = true
 disabled = false
 enforceCaptureSignature = false
 groupId = null
 fromFile = false
 tooltip = ""


srunjeet | Posts: 3

Reply to: Condition logic on Signature capture with text tags

0 votes

Hi Steve

Retrieve the package Object first, then you should have the field ids.

 DocumentPackage package = eslClient.getPackage( packageId );


Attachments

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off