[BUG] Slack direct message interpolation doesn't work for `$`
Describe the bug
When using the slack direct message action and using a value from a previous step that has a dollar sign ($) in it, the interpolation doesn't work and it throws an error
To Reproduce Steps to reproduce the behavior:
- Create a workflow
- Add a Slack direct message action
- add an interpolation to the
Textfield that contains a$, e.g.{{steps.my_step.$return_value}} - Run it
Expected behavior It should interpolate and THEN send the message further to the Slack API.
Escaping in any way, e.g. {{steps.my_step.\$return_value}} doesn't seem to make a difference.
I can't actually find the interpolation code in this repository here, it might be closed source as it's part of the product itself.
Given that other interpolations with {{}} work, my assumption is that somewhere it doesn't match $ correctly.
Screenshots
Setup:
error:
@joscha, would you mind sharing the whole text of your Text prop if possible?
I couldn't seem to reproduce your issue (given to reproduce steps that you provide)
@vunguyenhung you can see the full text in the screenshot above (except for a sensitive URL which I have masked). Can you try this text? The URL itself without the interpolation containing $ works, so I don't suspect this to be the issue, but if you can still not reproduce it, I can send you the workflow ID via the pipedream support channel.
Update: I also noticed that there is an array access ([0]) in the same interpolation, maybe that makes a difference in combination with the $ and the error message is just not precise?
@joscha Would escaping the backticks like this works for you?
* 🔎 scan of \`{{steps.code.$return_value}}\` started * - <http://www.example.com|This message *is* a link>
@joscha Would escaping the backticks like this works for you?
Oh, I wasn't aware the back ticks needed to be escaped. Apologies I had missed that they could be an issue.
I assumed they'd be sent verbatim as the text block was going to be processed. Escaping is not a problem at all, will the text still show up as inline code in Slack?
And can you make sense of the error message relating to the $? If this error message is constructed by pipedream it might make sense to improve it?
@joscha the text shown like this in Slack (given my example)
And can you make sense of the error message relating to the $? If this error message is constructed by pipedream it might make sense to improve it?
This is related to Pipedream internals. Maybe @ctrlaltdylan has more context.
Hey @ctrlaltdylan, when you have time, could you do a check to see if we can improve this?
Without more information, I'm going to close this issue. Feel free to reopen and add more details, if you'd like.