DocMerge - using a condition about a Relationship field type value

Hello, 

I'm working on a template to be used on Meetings module.

On the meetings module, the assigned_user_name field is appended to gather further data from the Users module

I would like a text be displayed on the document only if the field status_c (type liste of choix) of the user has the value 'green'.

I can display the value of the field status_c on the template, but when I tried to add a condition about this value,It seems that the condition is not being taken into account.

Exemple : displaying like this is working : 

{assigned_user_name.status_c}

but doesn't work on a condition : 

{assigned_user_name.status_c == 'green'} Text to display on document {endif}

Is docMerge accepting Relationship field types on conditions? If yes, could someone describe how to do it? 

Thank you!

Parents
  • Hi Montserrat,

    You can get this result by using Sugar Logic on the template assistant, after selecting the Meetings module as main module.

    There, you need to build an IfElse formula, with something like the following:

    ifElse(equal(related($assigned_user_link, "status_c"),"green"),"text to show","")

    The assistant will build the following code that you need to copy and paste on your template:

    {!formula value='ifElse(equal(related($assigned_user_link, "status_c"),"green"),"text to show","")'}

    Hope this helps but let me know should you have any questions.

    Best,

    Francesc

Reply
  • Hi Montserrat,

    You can get this result by using Sugar Logic on the template assistant, after selecting the Meetings module as main module.

    There, you need to build an IfElse formula, with something like the following:

    ifElse(equal(related($assigned_user_link, "status_c"),"green"),"text to show","")

    The assistant will build the following code that you need to copy and paste on your template:

    {!formula value='ifElse(equal(related($assigned_user_link, "status_c"),"green"),"text to show","")'}

    Hope this helps but let me know should you have any questions.

    Best,

    Francesc

Children