Use Message Properties in Node Configuration

Hello, I am trying to use the Azure Blob Storage Node,
I can get it to upload a file to a folder, how I want, if I statically type in the values into the 'Storage Blob Name' section. However the problem is I want these to be dynamic.

How would I go about making these dynamic and using properties on my message payload?

Note, in the screenshot above, I tried using the handlebars syntax, as isa common replacement in other things I am familiar with, but that did not work. It just made a folder name {{msg.devicename}} and a file within that named {{msg.filename}}.

If msg.devicename = XYZ, and msg.filename = "data.json", I want it to place a folder named XYZ, and a file named data.json.

Which node are you using (node-red-contrib-something probably) and does the help text for the node say you can pass the data in the message?

A node ability to allow you to dynamically supply configuration values depends on how the author wrote the node.

You should see documentation in the help screen of the node explaining what can be dynamically supplied.

If it doesn’t exist, you can ask the author (on the node’s GitHub page) to provide that functionality.

The package I am using is: node-red-contrib-azure-blob-storage

I think I figured it out.

So it seems like it uses whatever the path of the file is, at msg.payload. The slight problem with that is that when you have the file on your 'in my case' linux system, I could not imagine how that file path translates up into the Azure Blob.

so msg.payload becomes both the file that is uploaded, as well as the intended filename.

What ended up working is setting the filename to upload to be...:
devicename\filename.json

Those are the wrong slashes for Linux, so instead of creating it in a nested folder, it just creates a file literally named: devicename\filename.json
(Not sure if the double slashes are required).
Then when this particular node goes to upload it to Azure, it parses that, sees the slashes, and puts it into the proper folder structure on Azure Blob Storage.

So in my case, that 'Storage Blob Name' is blank now, and it is being pulled from msg.payload.
That, as well as the slash confusion between a Linux and a Windows system is what caused problems.

Thank you guys for replying, I was not sure if I was just missing something obvious in the Node Properties configuration or not.

You can use forward slashes with windows.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.