How to extract key from set command?

Hey the support is fantastic, thanks for all your help so far.

I was wondering how you might extract a key from a set command? I just noticed there is no text manipulation.

Hi @jtas21, to manipulate text you would currently need to use pure JavaScript I am afraid. There are a few feature requests around this though (for example A text replace node), so you might want to leave your vote there.

Community members @lublak and @pemontto have actually built some nodes for this already, but the PRs (add TextManipulation node by lublak · Pull Request #1426 · n8n-io/n8n · GitHub, WIP:✨ New transform node to manipulate data by pemontto · Pull Request #2548 · n8n-io/n8n · GitHub) are still open meaning these nodes aren’t available in the general n8n releases yet.

As for your specific example I take it you’d like to extract w98dhwdoNMWnnw0n and write it in its own field? If so, I would use JavaScript’s .match() for that and a suitable regular expression. These can be used directly inside n8n expressions. Here’s an example where I am using the Set node for this:

image

Example Workflow
1 Like

Thanks for the help @MutedJam!

Will also upvote!

1 Like