Doc Merge: filtering records based on what a field contains

Hi,

I would like to create a document which displays all the notes of a certain account which contain a certain word in their description, or in their tags.

I couldn't find the syntax to create a conditional rule based on the content of the field. Following the appendix, I've tried with 

{#notes}{if (description.filter(item=>item.includes("bal")).length>0)}{name}

{date_entered}

{created_by_name.user_name}

{description}{endif}

{tag}{/notes}

but I get the error "description.filter is not a function"

I'm not sure to understand the syntax needed.

Could you help me?

Thanks,

Raul

  • Hello  , 

    Thanks for bringing this up. 

    I've been trying myself and the syntax is quite different as you are filtering on a collection.
    Can you try with something like this: 

    Fullscreen
    1
    2
    3
    4
    Print only notes with Bananas on Description
    Subject Last Modified Date created Contact Name Description Assigned User Name
    {#notes} {if description.includes('banana')>0}{name} {date_modified} {date_entered} {contact_name} {description} {assigned_user_name}{endif}{/notes}
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    Let me know if this works for you. 

    Cheers, 

    André