Skip to main content
Solved

Need assistance with SuppressTableRow merge tag


Forum|alt.badge.img+3

Our instance of DocuSign in integrated with Salesforce. I am trying to build a template document in Word and am having issues with the SuppressTableRow merge tag. I need to build logic that will suppress a table row if field RBD1 has the same value as R90BD1 AND RNEGD1 has the same value as R90NEGD1. This merge tag was suggested by AI but it’s not working. Can anyone assist? Thanks!

 

<# <SuppressTableRow Test="(Pharmacy_Products[1]/RBD1 = Pharmacy_Products[1]/R90BD1) and (Pharmacy_Products[1]/RNEGD1 = Pharmacy_Products[1]/R90NEGD1)"/> #>

Best answer by Oskay Taskin

Wow! 2 of my favorite people in 1 thread!!! ​@RobinD I hope everything is great in your world!

Short answer first - try this and let me know if it works: 

<# <SuppressTableRow Select=”((//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1]))” Match=””/> #>

I can’t say confidently this will work without having tested, since I don’t have access to your XML and DocGen, but I recreated it with some assumptions. There are several ways we can pull this off though.
___________________________________

Long answer now - You can use AI/LLM tools like ChatGPT with helping create merge tags for you, I’ve found it to be super useful, but sometimes they can set you on the wrong track because they don’t understand the limitations of our CLM tool. Merge tags are built on XPath, so when I talk to ChatGPT, I don’t mention anything about DocuSign and ask them to create an XPath based on the XML from our DocGen form - which is <Params> in the Workflow Activity, as you know it in CLM.

So in this scenario, you are trying to suppress a row based on 2 criteria. So you chose the correct merge tag type - SuppressTableRow!

Here is the shell for that Merge Tag that works with DocuSign CLM. Then the XPath inside of it is what you can customize and talk to ChatGPT about.

<# <SuppressTableRow Select=”(//XPATH INSERTED HERE)” Match=””/> #>

I can ask, based on the following XML (Params in Workflow Activity), can you give me an XPath to match with the following criteria. That prompt can give you something like this:


Then I can go into xpather.com to validate my Xpath provided by ChatGPT is correct (see screenshot)

(//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1])

Then I can plug that Xpath ChatGPT gave me, into my merge tag and I get the following!

<# <SuppressTableRow Select=”((//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1]))” Match=””/> #>

It might not work first time - but should be close! It’s a little tricky the first time but once you get the hang of it, you can solve every potential merge tag use case that comes your way.

View Original
Is this content helpful?

13 replies

JohnSantos
Valued Contributor
Forum|alt.badge.img+18
  • Valued Contributor
  • 968 replies
  • January 8, 2025

@RobinD 

Since every tenant may use slightly different syntax depending on whether they’re using DocuSign CLM (formerly SpringCM), DocuSign eSignature for Salesforce Advanced Templates, or even older custom code, some trial-and-error is often necessary.  Can you confirm if you are using DocuSign CLM or DocuSign eSignature Advanced Templates?


Forum|alt.badge.img+3
  • Author
  • New Voice
  • 7 replies
  • January 8, 2025

@JohnSantos I am using Docusign CLM. Thanks!


Forum|alt.badge.img+3
  • Author
  • New Voice
  • 7 replies
  • January 13, 2025

@JohnSantos would you be able to help me with this by any chance?

This statement hides the table row regardless if it evaluates to true or false (I need it to evaluate to true)

<# <SuppressTableRow Select="(//Pharmacy_Products[1]/RBD1 = //Pharmacy_Products[1]/R90BD1) and (//Pharmacy_Products[1]/RNEGD1 = //Pharmacy_Products[1]/R90NEGD1)" NotMatch=”true”/> #>

Changing to Match=true doesn’t not suppress the row regardless if it evaluates to true or false.


Forum|alt.badge.img+3
  • Author
  • New Voice
  • 7 replies
  • January 13, 2025

@Oskay Taskin tagging you because you have also been so helpful to me in the past! 


JohnSantos
Valued Contributor
Forum|alt.badge.img+18
  • Valued Contributor
  • 968 replies
  • January 13, 2025
RobinD wrote:

@Oskay Taskin tagging you because you have also been so helpful to me in the past! 

@Oskay Taskin is the best in the business.  You are in really good hands with him.


Forum|alt.badge.img+2
  • New Voice
  • 4 replies
  • Answer
  • January 14, 2025

Wow! 2 of my favorite people in 1 thread!!! ​@RobinD I hope everything is great in your world!

Short answer first - try this and let me know if it works: 

<# <SuppressTableRow Select=”((//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1]))” Match=””/> #>

I can’t say confidently this will work without having tested, since I don’t have access to your XML and DocGen, but I recreated it with some assumptions. There are several ways we can pull this off though.
___________________________________

Long answer now - You can use AI/LLM tools like ChatGPT with helping create merge tags for you, I’ve found it to be super useful, but sometimes they can set you on the wrong track because they don’t understand the limitations of our CLM tool. Merge tags are built on XPath, so when I talk to ChatGPT, I don’t mention anything about DocuSign and ask them to create an XPath based on the XML from our DocGen form - which is <Params> in the Workflow Activity, as you know it in CLM.

So in this scenario, you are trying to suppress a row based on 2 criteria. So you chose the correct merge tag type - SuppressTableRow!

Here is the shell for that Merge Tag that works with DocuSign CLM. Then the XPath inside of it is what you can customize and talk to ChatGPT about.

<# <SuppressTableRow Select=”(//XPATH INSERTED HERE)” Match=””/> #>

I can ask, based on the following XML (Params in Workflow Activity), can you give me an XPath to match with the following criteria. That prompt can give you something like this:


Then I can go into xpather.com to validate my Xpath provided by ChatGPT is correct (see screenshot)

(//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1])

Then I can plug that Xpath ChatGPT gave me, into my merge tag and I get the following!

<# <SuppressTableRow Select=”((//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1]))” Match=””/> #>

It might not work first time - but should be close! It’s a little tricky the first time but once you get the hang of it, you can solve every potential merge tag use case that comes your way.


Forum|alt.badge.img+3
  • Author
  • New Voice
  • 7 replies
  • January 14, 2025

@Oskay Taskin! So great to hear from you, and that you so much for the detailed explanation. Everything is good over here!

Unfortunately this is still not working. No matter what I try, it either hides the row regardless of how it evaluates or shows it. I feel like this might be too complicated to solve via this forum, and I’ve spent a ton of time on it. Maybe it just can’t be done! I really appreciate your help!


Forum|alt.badge.img+3
  • Author
  • New Voice
  • 7 replies
  • January 14, 2025

@Oskay Taskin ok I decided to keep diving into this. I must be a glutton for punishment! In Freeformatter.com, I entered this in the XLM box:

<Pharmacy_Products>
    <RBD1>123</RBD1>
    <R90BD1>123</R90BD1>
    <RNEGD1>456</RNEGD1>
    <R90NEGD1>456</R90NEGD1>
</Pharmacy_Products>

And this in the xpath box:

boolean(//Pharmacy_Products[RBD1 = R90BD1 and RNEGD1 = R90NEGD1])

and the statement evaluated correctly. 😊

I then put this into my template and it’s not evaluating properly:
<# <SuppressTableRow Test="(//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1])" /> #>

I also tried this to no avail:

<# <SuppressTableRow Select="(//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1])" Match="" /> #>

Any thoughts?


Forum|alt.badge.img+3
  • Author
  • New Voice
  • 7 replies
  • January 14, 2025

@Oskay Taskin  I got it to work! I looked at my xml and noticed there were these xxx_unformatted fields so I used them instead: 

<# <TableRow Select="//Pharmacy_Products[1]" /> #>

<# <SuppressTableRow Test="./RBD1_unformatted = ./R90BD1_unformatted and ./RNEGD1_unformatted = ./R90NEGD1_unformatted" /> #>

Glad I decided to stick it out. Thanks again for setting me on the right path!!


Forum|alt.badge.img+2
  • New Voice
  • 4 replies
  • January 14, 2025

Not a glutton for punishment! We’re almost there. Love that you were able to get the XPath to evaluate correctly! This is always the key step.

I just recreated a DocGen & template in my sandbox and was able to get the merge tag working with the logic you provided! It needed “NotMatch” instead of “Match” - I always get the 2 mixed up. 

The new merge tag that worked for me:

<# <SuppressTableRow Select=”((//Pharmacy_Products[1][RBD1 = R90BD1 and RNEGD1 = R90NEGD1]))” NotMatch=””/> #>
 

(A link here explaining the different between Match vs NotMatch and Conditional Select vs Conditional Test)

Assuming the XML coming out of your DocGen does look like the below (with repeating Pharmacy_Products nodes), I’m confident the above tag should work:

<Pharmacy_Products>
    <RBD1>123</RBD1>
    <R90BD1>123</R90BD1>
    <RNEGD1>456</RNEGD1>
    <R90NEGD1>456</R90NEGD1>
</Pharmacy_Products>

<Pharmacy_Products>
    <RBD1>ABC</RBD1>
    <R90BD1>DEF</R90BD1>
    <RNEGD1>GHI</RNEGD1>
    <R90NEGD1>JKL</R90NEGD1>
</Pharmacy_Products>

<Pharmacy_Products>
    <RBD1>MNO</RBD1>
    <R90BD1>PQR</R90BD1>
    <RNEGD1>TUV</RNEGD1>
    <R90NEGD1>WXY</R90NEGD1>
</Pharmacy_Products>

Let me know if this works. If not, your DocGen may be slightly different than what I assumed on mine, but I can feel that we’re almost there!


Forum|alt.badge.img+2
  • New Voice
  • 4 replies
  • January 14, 2025

@RobinD - forgot to tag you on the above response 🙂 Let me know, I’m determined to get this working!


Forum|alt.badge.img+2
  • New Voice
  • 4 replies
  • January 14, 2025

@RobinD Lol - clearly I’m not savvy with the forum yet, I just saw you responded before I started to test again. Nice catch noticing the _unformatted nodes! Yep as you noticed, those are easier to work with since they remove any currency, date or number specific formatting etc. Glad I could be of some use😄 Happy 2025!


Forum|alt.badge.img+3
  • Author
  • New Voice
  • 7 replies
  • January 15, 2025

@Oskay Taskin thank you so much again for all your help!