How use flow variable?

I get the id of a Tunein station that I memorize

{
    if(data[i]["data-nextguideitem"] != null 
        && data[i]["data-testid"] === "guideItem-0")
    {
        msg.payload = data[i]["data-nextguideitem"];

        if(flow.get("franceInter") !== msg.payload) 
        {
            flow.set("franceInter", msg.payload);
        }
        return msg;
    }
}```

and I want to inject into a node Sonos : 

$env(flow.get("franceInter"))

but I get : 

```group.play.tunein: radio id (payload) >>$env(flow.get("franceInter")) wrong syntax. Regular expr. - see documentation :: Details: none```

Thank for your help
:

$env(flow.get("franceInter"))

I don't think that is correct syntax.

$env gets the environment variable.

So you are doing to get things.

I also don't get what that you are wanting to do with the code you posted.

I didn't import the bigger code you posted because I don't think I have that second node and so won't be able to test it anyway.

I would like to call my variable from this node

Sorry. I have no knowledge of that node or how it works.

Just the code you posted doesn't look right.

Only "string" or "number" ?

package "node-red-contrib-sonos-plus" - "Universal" node

You will have to retrieve the context before the sonos node and pass it in as a payload. You cannot retrieve it as your screenshot because its expecting a string or a number.
Have you read the link see documentation?

Yes but I don't see the solution ...

If you are saving the radio station id to flow.context in the format described in see documentation -

REGEX check. the TuneIn radio station id such as 's97033'. Don't add additional blanks or whitespace.

then add a change node before the sonos node to retrieve that data, and feed it into sonos as a payload

flow

I don't use this node, so can't help you further, but hopefully another user may be able to.

Ok thank. I tried without success

What is the value of that ?

The value is : s24875

I found out how to do it
I load the variable from a function before injecting it into the node, leaving the payload field empty
Thanks to everyone who took the time

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