Skip to main content
nrao01
Participant
May 29, 2026
Question

count with predicate query not working

  • May 29, 2026
  • 1 reply
  • 3 views

I am using Adobe Acrobat Sign for salesforce. I am trying to get below expression to work for template but it doesnt

 

{% conditional-section expr($count(`SBQQ__Quote__c`.`SBQQ__LineItems__r`[$contains(`SBQQ__ProductCode__c`, "Top Up")]) > 0 ) %}

/////////lorem ipsum dolor…//////

{% end-section %}

 

what I am trying to do here is check if a CPQ quote has top up lines, if yes display a section.

The above expression fails to get the count of top up lines. I have ensured SBQQ__ProductCode__c field is tagged in document tagging section.

 

Please let me know what I am doing wrong here or if this is a bug

 

Thanks

    1 reply

    Anand Sri Bhattacharya
    Community Manager
    Community Manager
    May 29, 2026

    Hello @nrao01


    I hope you are doing well, and thanks for sharing the details. We're sorry for the trouble you had.


    We'll get this checked internally and will get back to you with an update.


    Please note that:

    Acrobat Sign’s text tag language is limited: The built-in text tag/conditional syntax in Acrobat Sign templates is intentionally simple. The official Text Tag Guide doesn’t cover complex expressions like counting array elements or filtering by conditions. For example, adding a function call, such as $count(ChildRecords[criteria]) inside a conditional-section tag is not documented in Adobe’s user-facing guides, indicating it’s not a supported feature in standard Acrobat Sign templates. Check this article for more details: Adobe Acrobat Sign for Salesforce: Mappings and Templates Guide


    Document Generation API uses JSONata (developer feature): The syntax you’re using with backticks, $count(), and $contains() comes from Adobe’s Document Generation (which uses the JSONata query language). Adobe’s developer blog confirms $count() can be used with filters in Document Generation API templates. However, that capability is part of the Acrobat Services Document Generation API, not the out-of-the-box Salesforce integration.


    Salesforce integration expects merge mappings or Document Builder: In the Acrobat Sign for Salesforce environment, the officially supported way to include related records (like Quote Line Items) is through Merge Mapping or the newer Document Builder. For example, Adobe’s documentation notes that you can automatically add product lists (e.g., Quote Line Items) and even filter or sort them via merge mappings. These tools populate your template with the relevant data before sending for signature, rather than relying on complex real-time expressions in the text tags.


    However, I will get more information on this, will share an update.


    Regards,

    Anand Sri.