Hope I'm not repeating a question, couldn't find an appropriate existing thread.
I'm trying to make a flow that uses flow context variables, rather than static values set throughout different nodes within the flow.
So I started a tab containing two wired node sets.
One flow sets the flow context variables to the unique values.
The other flow is the work, and supposed to use the context variables to set data values.
The first payload is an array returned from an SNMP query, so I have a change node move the data I want from the array to just msg.payload. This works fine.
Then the variables come into play.
I added rules to change msg.payload: search for flow.variable1, replace with flow.variable2.
It ignores the search/replace rules.
I added a switch node to see if it's actually reading the data within variable, and it does appear to be.
What am I doing wrong?
*Edited to hopefully make more comprehensible.
[
{
"id": "09d82a28e3e9a8f1",
"type": "tab",
"label": "Troubleshooting Iso",
"disabled": false,
"info": "",
"env": []
},
{
"id": "c44cf6f571661e68",
"type": "ui_text",
"z": "09d82a28e3e9a8f1",
"group": "3990be236485e116",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "Current Monitor: ",
"format": "{{msg.payload}}",
"layout": "row-spread",
"className": "",
"x": 1480,
"y": 340,
"wires": []
},
{
"id": "ee949e0b114a624e",
"type": "change",
"z": "09d82a28e3e9a8f1",
"name": "",
"rules": [
{
"t": "move",
"p": "payload.0.value",
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "signal1",
"fromt": "flow",
"to": "calls1",
"tot": "flow"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "signal2",
"fromt": "flow",
"to": "calls2",
"tot": "flow"
},
{
"t": "set",
"p": "FM-INO",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 340,
"wires": [
[
"03297ae82a54b210",
"b7188842c064e69d",
"cc0e8dfe53848d02"
]
]
},
{
"id": "640907369cca4843",
"type": "inject",
"z": "09d82a28e3e9a8f1",
"name": "",
"props": [
{
"p": "payload.0.value",
"v": "9510",
"vt": "num"
}
],
"repeat": "12",
"crontab": "",
"once": true,
"onceDelay": ".1",
"topic": "",
"x": 270,
"y": 340,
"wires": [
[
"ee949e0b114a624e"
]
]
},
{
"id": "f49ada1a78f429d9",
"type": "change",
"z": "09d82a28e3e9a8f1",
"name": "",
"rules": [
{
"t": "set",
"p": "calls1",
"pt": "flow",
"to": "Station1",
"tot": "str"
},
{
"t": "set",
"p": "signal1",
"pt": "flow",
"to": "9510",
"tot": "num"
},
{
"t": "set",
"p": "calls2",
"pt": "flow",
"to": "Station2",
"tot": "str"
},
{
"t": "set",
"p": "signal2",
"pt": "flow",
"to": "10410",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 200,
"wires": [
[
"971f32048ed00c38"
]
]
},
{
"id": "cc0e8dfe53848d02",
"type": "change",
"z": "09d82a28e3e9a8f1",
"name": "",
"rules": [
{
"t": "set",
"p": "FM-INO",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 980,
"y": 340,
"wires": [
[
"0f47b7e8e9273f2f",
"c44cf6f571661e68"
]
]
},
{
"id": "90b9a97fa38933f1",
"type": "inject",
"z": "09d82a28e3e9a8f1",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 270,
"y": 200,
"wires": [
[
"f49ada1a78f429d9"
]
]
},
{
"id": "e8b88d95da60f69b",
"type": "debug",
"z": "09d82a28e3e9a8f1",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 850,
"y": 200,
"wires": []
},
{
"id": "971f32048ed00c38",
"type": "change",
"z": "09d82a28e3e9a8f1",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "calls1",
"tot": "flow"
},
{
"t": "set",
"p": "payload2",
"pt": "msg",
"to": "signal1",
"tot": "flow"
},
{
"t": "set",
"p": "payload3",
"pt": "msg",
"to": "calls2",
"tot": "flow"
},
{
"t": "set",
"p": "payload4",
"pt": "msg",
"to": "signal2",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 680,
"y": 200,
"wires": [
[
"e8b88d95da60f69b"
]
]
},
{
"id": "0f47b7e8e9273f2f",
"type": "debug",
"z": "09d82a28e3e9a8f1",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1150,
"y": 280,
"wires": []
},
{
"id": "03297ae82a54b210",
"type": "debug",
"z": "09d82a28e3e9a8f1",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 850,
"y": 280,
"wires": []
},
{
"id": "b7188842c064e69d",
"type": "switch",
"z": "09d82a28e3e9a8f1",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "signal1",
"vt": "flow"
},
{
"t": "eq",
"v": "signal2",
"vt": "flow"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 950,
"y": 440,
"wires": [
[
"91f6f57ff1ab93ea"
],
[
"5ab7ce158e853e99"
]
]
},
{
"id": "401e44489a9d2d41",
"type": "debug",
"z": "09d82a28e3e9a8f1",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1450,
"y": 420,
"wires": []
},
{
"id": "728433af94ef31d0",
"type": "debug",
"z": "09d82a28e3e9a8f1",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1450,
"y": 460,
"wires": []
},
{
"id": "91f6f57ff1ab93ea",
"type": "change",
"z": "09d82a28e3e9a8f1",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "signal1",
"fromt": "flow",
"to": "turtle",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "signal2",
"fromt": "flow",
"to": "calls2",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1240,
"y": 420,
"wires": [
[
"401e44489a9d2d41"
]
]
},
{
"id": "5ab7ce158e853e99",
"type": "change",
"z": "09d82a28e3e9a8f1",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "signal1",
"fromt": "flow",
"to": "turtle",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "signal2",
"fromt": "flow",
"to": "frog",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1240,
"y": 460,
"wires": [
[
"728433af94ef31d0"
]
]
},
{
"id": "f75ace522f327043",
"type": "inject",
"z": "09d82a28e3e9a8f1",
"name": "",
"props": [
{
"p": "payload.0.value",
"v": "10410",
"vt": "num"
}
],
"repeat": "6",
"crontab": "",
"once": true,
"onceDelay": "6",
"topic": "",
"x": 270,
"y": 400,
"wires": [
[
"ee949e0b114a624e"
]
]
},
{
"id": "3990be236485e116",
"type": "ui_group",
"name": "Test",
"tab": "9aa0f74a5fd39f0f",
"order": 3,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "9aa0f74a5fd39f0f",
"type": "ui_tab",
"name": "Monitor System",
"icon": "device_hub",
"disabled": false,
"hidden": false
}
]