Backtick in text breaks variable parsing

I’m using slack “Send Message to a Private Channel” and using a backtick (`) in text breaks pipedream

Text field, with some formatting eaten by discourse:

{{steps.apply_transform.$return_value.prev_rate}}

   code

====

Error

steps.apply_transform.$return_value.our_rate is not a function

DETAILS

TypeError: steps.apply_transform.$return_value.our_rate is not a function
    at eval (eval at _pd_deep_evaluate (/var/task/params_evaluator.js:63:16), <anonymous>:3:2)
    at _pd_deep_evaluate (/var/task/params_evaluator.js:63:16)
    at MessagePort.<anonymous> (/var/task/params_evaluator.js:11:9)
    at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:399:24)
    at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)

Hello @dsidorenko,

First off, welcome to Pipedream! Happy to have you!

I couldn’t to reproduce your issue with minimal step as below

On more detail, I added a Node step that returns the string with backtick: “Hello `world`!”. Then I added a Slack step that use Text prop reference the Node step result.

Would you mind sharing the input of your Slack “Send Message to Private Channel action”?

Hi @vunguyenhung

thanks for the quick response.

Here is a screenshot

Hello @dsidorenko,

I afraid the input you put in the Text field is invalid. I would suggest to transform the text value in your code step (.i.e apply_transform step), then use only the reference in the Text field. For example:

@vunguyenhung

What makes it invalid?
I’m using those values in other steps with no issues.
Furthermore, if I delete backquotes from text field everything works fine. I only have issues when Text has a backquite in it.
Even more. If I keep backquote, but use $return_value from another step it still gives me an error

No error here

Still an error

I think what makes it invalid is the backtick is not escaped, as the backtick is can be the function call in javascript

You can escape the backtick like this and it should work

{{steps.node.$return_value}}
\`\`\`
Nice!
\`\`\`

Yes, just figured it too. Escaping works, no need for return_value manipulation you suggested.
Thanks for helping!

I’d still categorize that behavour as a bug. My expectation was that Text field is taken as is.

1 Like