How to rename multiple binary's with its own filename and extension

I try to rename multiple binary’s which i get with a sharelink.

I try out this flow:

How do i rename each binary with its own individual filename and extension?

Hi @UweG, I’d suggest using the Function Item node for this transformation. This runs once for each item, meaning you wouldn’t have to worry about looping yourself.

Here’s your example workflow updated with the Function Item node:

This example uses the getBinaryData() + setBinaryData() methods.

Result:

1 Like

In your original Function node you’re using $item(0) and thus always referencing the JSON data from your first item. If you replace $item(0) with $item(index) this should also work:

Thank’s a lot
Every time i asked a question, i get smarter with the community answer.

1 Like

Awesome, glad to hear this helped!

Good afternoon. The setBinaryData() and getBinaryData() functions in the new Code nodes have stopped working - ERROR: getBinaryData is not defined
Can you please tell me how to initiate them or what to replace them with?

Thank you.

2 Likes