Auto-Stringify Drag+Drop in Node Raw JSON Editor

The idea is:

Hold a key on the keyboard (like “s” or SHIFT, etc) when drag+dropping a property into a field to stringify the value in the field.

My use case:

You are editing in a Node, any node with input fields. You want to drag a property from the JSON in the `previous node` panel -- and stringify that value.

I think it would be beneficial to add this because:

Instead of:

  1. dragging in the property, then
  2. switching hand to the keyboard,
  3. moving cursor to the beginning of the property token,
  4. typing "JSON.stringify(", then
  5. moving cursor to the end to close the parenthesis...

...what if we could just hold SHIFT while dropping the property? Ahhhh! Breath of fresh air! How easy! What a delight! Using n8n has never been so glorious.

Any resources to support this?

:man_shrugging: Keyboard shortcuts | n8n Docs

Are you willing to work on this?

Yes, any way I can.

EP

+1 Great idea :slight_smile:

Not sure if we would even need to hold shift - we should be able to just automatically stringify it and it shouldn’t take away any functionality

Btw - there is a convenience method now .toJsonString() which is a little more convenient than doing Json stringify

But my favorite trick is pretty printing with JSON.strigify( {{ $json }}, null, 2 )

1 Like