Changing file name from binary

I’m using HTTP Request to get the pdf from a Gogle Docs, but the file name is shown as Export, is it possible to replace this name with the actual file name?

You can use the function node with the following code to do so. It might be worth adding it as an option to the HTTP node, though.

items[0].binary.data.fileName = 'newname.pdf'
return items;
Example workflow
4 Likes

Perfect @RicardoE105

Thank you very much!

As I need to use the name of the file that is in Drive, it looks like this :+1::wink:

items[0].binary.data.fileName = $node["Google Drive Trigger"].json["name"]+'.pdf' 
return items;
1 Like

Hi,

I’m using the code to change the file name to the original gdocs name, but only the first file is changed. The rest is still shown as “Export”. Any help on this?

Hi @Azril

I solved this problem by adding an Items Lists (configured as pictured) after the IF and including a Loop

Capturar1

I took advantage of your appointment to adjust my flow to avoid future problems, which would certainly occur.

1 Like

Yes, now its working perfectly.
Many thanks for your workflow!!

2 Likes