Hello!
You might need to leverage storing the value you want to test inside of an expression node first so you can call it inside of your Slack App with a placeholder. Another thing to be aware of is if the value from the checkbox of the place holder actually equals Yes/No or True/False or true/false as Freshservice stuff is kind of sensitive to that particular boolean type of info.
We don't use the slack app but we recently did use if statements with liquid filters. The trick my co-worker found was that you have to use single quotes and not double quotes when referring to what string you are checking with. We tried to use if and elsif like the documentation said would work but we found out that elsif didn’t work properly. Instead we chose just 3 if statements instead. Here is an example of what we have in a note that gets sent depending on a dropdown selection from a service item. The … are inputted into placed that had info I had to scrub :)
edit: Sorry if the code adds weird bolding. This is code meant for Freshservice and there isn’t an option meant for it in the code block settings here.
{% if {{ticket.ri_530_cf_access_level}} == 'Option 1' %}
… {{ticket.ri_530_cf_access_level}} Access Request approved by …
Request For: {{ticket.actual_requester.name}}
Requested for Login ID: {{ticket.actual_requester.email | remove: '@email.com'}}
Requested for Job Title: {{ticket.actual_requester.job_title}}
Selected PPM: {{ticket.ri_530_cf_approver}}
Last Approver: {{approval.last_approver_name}}
{% endif %}
{% if {{ticket.ri_530_cf_access_level}} == 'Option 2' %}
… {{ticket.ri_530_cf_access_level}} Access Request approved by …
Request For: {{ticket.actual_requester.name}}
Requested for Login ID: {{ticket.actual_requester.email | remove: '@email.com}}
Requested for Job Title: {{ticket.actual_requester.job_title}}
Selected PPM: {{ticket.ri_530_cf_approver}}
Last Approver: {{approval.last_approver_name}}
{% endif %}
{% if {{ticket.ri_530_cf_access_level}} == 'Option 3' %}
… {{ticket.ri_530_cf_access_level}} Access Request Approved by …
Request For: {{ticket.actual_requester.name}}
Requested for Login ID: {{ticket.actual_requester.email}}
Requested for Job Title: {{ticket.actual_requester.job_title}}
Selected PPM: {{ticket.ri_530_cf_approver}}
Selected LT Member: {{ticket.ri_530_cf_regiondeptasstsuperintendent}}
Last Approver: {{approval.last_approver_name}}
{% endif %}
Greetings all,
I am building a workflow to add field values selected in a service item into a Slack app orchestration. I have a series of checkboxes that the requester can check. I want to perform a liquid filter if statement to post a specific message if the box is checked.
{% if ticket.ri_179_cf_salesforce == "Yes" %}
Salesforce: :white_check_mark:
{% endif %}
Unfortunately, when I do this, the field is no longer testable via the Test input params as it isn’t recognized. Are if statements supported in workflows and app actions specifically?
if it’s a checkbox that it’s true or false value
just use this then
{% if ticket.ri_179_cf_salesforce %}
Salesforce: :white_check_mark:
{% endif %}
Is this in a web request nod ?