Question

use of #if

  • 15 February 2024
  • 3 replies
  • 32 views

Try to create an if when you are category “Help desk”, otherwise go to the spanish section. 

 

#if( ${Category}!="Help Desk")#else Category: ${Category} Sub Category  ${SubCategory}

Title: ${Title}

Description: ${Description}

#end

Categoría: ${Category}  Sub Categoría  ${SubCategory}  Título: ${Title}
#if( ${Description} && ${Description}!="")  Descripción de la solicitud: ${Description} 
#end

but always puts both options

I need that if it is "help desk" it stays until the #end in red,  and if it is not "help desk" that happens after the #end in red

 

thanks 

 


3 replies

Userlevel 1
Badge +1

Hi Joseph,

You might want to use #elseif instead of #end for that.

 

Here is our documentation explaining how it works:

English: https://documentation.sysaid.com/docs/custom-notification-form

Spanish: https://documentation.sysaid.com/docs/formulario-de-notificacion-personalizado

Userlevel 3
Badge +1

Hi @Joseph Pineda,

Please use the below code and let me know if it works for you.

#if( ${Category} == "Help Desk")

Category: ${Category} Sub Category ${SubCategory}

Title: ${Title}

#if( ${Description} && ${Description}!="")  Description: ${Description}

#end

#else

Categoría: ${Category}  Sub Categoría  ${SubCategory}  Título: ${Title}
#if( ${Description} && ${Description}!="")  Descripción de la solicitud: ${Description}

#end#end

 

Thank you iulian for the references, they will help me to give more details to the notifications.

Alin, thanks for an excellent demonstration. 

Reply