Globals variable in an https workflow node as the URL, in a custom node doesn't resolve

Hi,
I have a custom node that uses the http node to make an API call, and I’m trying to use a globals URL variable for the base external system URL path within its config (e.g. “{{globals.JasperSIMmanagementAPI}}/devices/{{data.iccid}}”, with virtual button tests in the editor on the custom node as well to inject a call to the URL, but it doesn’t resolve the globals variable value into the actual http URL path when called. I tried just accessing the globals variable in a debug message to display it, and a Mutate node to copy it into a local path variable, and these did not work either. Why can I not access the globals variable within the any runtime context in my custom node when developing this node?

Global values are not exposed to the payload; you’ll see this if you click one of your Virtual Buttons and view the example payload in its editor. All values must be explicitly passed into the custom node as inputs.

You have three options here …

  1. Create a required string template input for the base URL on the custom node and, wherever it is used, pass the value in from the global (i.e. {{globals.JasperSIMmanagementAPI}}). You’d then use that in the custom node with a template of {{data.apiBase}} (assuming you named the input “apiBase”).
  2. Set it at the top of the custom node in a Mutate Node to be used by all other nodes downstream of it. That would mean having to update the global variable in multiple spots should it ever change, though (in the global config and in the node’s Mutate Node).
  3. If you absolutely must pull it off a global value, you could use a Losant API Node with the Application: Get action in the custom node and then look up the value whereever it is used in the custom node. But that would be adding a lot of overhead to every invocation of the node.

Thanks for the info. FYI, I did try your option (2), but that didn’t resolve the globals value either. I don’t want to supply the URL as an input, so I’ll look into the Losant API suggestion. This custom node isn’t called that often.

In #2 I meant actually setting the value in the node, not trying to pull it from the globals object - as in a Mutate Node that sets a value of “https://my.api.base.com/…” at a path of, say, “working.apiBase” and then referencing that downstream.