Solved

Expression Builder with Liquid expressions.


Userlevel 6
Badge +9

Hello, 

Been testing the new Expression Builder block and found some ups and some downs. 

I created this expression using Liquid and the test gives me OK on it but I can’t save it. I get this when I click on done. 
Invalid Syntax - One of its operands is invalid.

 

{% assign home = "no" %}{% if {{home}} == "no" %}"no"{% else %}"yes"{% endif %}

 

 

My goal is something like this, create a 

{% if {{ticket.tag}} contains "ApprovalStep2" %}{{R3.approver1}},{{R3.approver2}},{{R3.approver3}},{{R3.approver4}}{% else %}{{R2.approver1}},{{R2.approver2}},{{R2.approver3}},{{R2.approver4}} {% endif %}

 

This is part of a Approval flow.  

My first action sets TAGS with this 

https://gist.github.com/varazir/f9c714f8193e45531e8c5fbcdc57e61b

Next action is to send approval message based on “to be approved by”-types there are. Using tags for conditions and don’t want to make 2 setups with send approval actions. 

 

( I wish there was a API option in the body when you send a note  “approveby”: “everyone” ) 

 

 

icon

Best answer by daniel.soderlund 19 May 2022, 11:38

View original

28 replies

Userlevel 6
Badge +9

@zachary.king  I hope you hade a good 4th July.
How did it go with the Freshservice support ? 

Hey @daniel.soderlund, thank you. Was a nice weekend to get away. Regarding the Expression Builder, the issues has been escalated to the backend team to take a look at. No resolution as of yet, but once I have one I will be happy to share it here.

Hi, heard anything new on this ? 

Userlevel 7
Badge +14

Hello @daniel.soderlund, they are still working on it. it looks to be an issue with the liquid placeholders. So they have some engineers taking a look at it. Have not gotten a full resolution yet.

Userlevel 7
Badge +14

So after a decent amount of troubleshooting by the development team they were able to help me get an expression to work that achieved the result I was looking for. It appears that it required additional methods from the Liquid Language, in my case it was the “append” method. So my assumption with the difficulty using the expression builder and placeholders syntax is figuring out how much to alter with the Liquid Language and how much to use the expression builder’s functions.

@daniel.soderlund I hope that helps some, but it is still a little vague, I know.

Reply