Hello everyone,
this is a bit difficult to explain, I think.
I am trying to vary one message parameter but I need to vary it in a bunch of flows simultaneously.
I want to change the ranges (like Excel ranges)
A1:A22
B1:B22
C1:C22
to e.g.
A4:A9
B4:B9
C4:C9
I was thinking of something like the code at te bottom but that is probably the worst possible approach (although it would work) because I need to trigger many nodes and create lots of nodes.
Ideally I have one node to define the starting number and end number and one node to define the letter and then join them.
Does anybody know if that is possible (for a newbie like me)?
Thank you all
Alex
EDIT:
Maybe I can inject msg.SelectRange with value "A1:A2" and then have a change node that can change the "1" and "2" to new values using a regular expression? Would that be possible? Although no idea what the regular expression would be for that.
(see next flow)
[
{
"id": "306ba3bd11863c34",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ec5df9bd8567b0cc",
"type": "inject",
"z": "306ba3bd11863c34",
"name": "start result",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
},
{
"p": "selectRange",
"v": "A1:A2",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"topic": "",
"payload": "",
"payloadType": "str",
"x": 500,
"y": 160,
"wires": [
[
"6ad7b76f52143be3",
"e5524ddca70c3f0b"
]
]
},
{
"id": "e5524ddca70c3f0b",
"type": "debug",
"z": "306ba3bd11863c34",
"name": "debug 6",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "selectRange",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 200,
"wires": []
},
{
"id": "6ad7b76f52143be3",
"type": "range",
"z": "306ba3bd11863c34",
"minin": "1",
"maxin": "2",
"minout": "1",
"maxout": "22",
"action": "scale",
"round": false,
"property": "selectRange",
"name": "",
"x": 650,
"y": 260,
"wires": [
[
"e5524ddca70c3f0b"
]
]
}
]
First flow
[
{
"id": "bf622e623503117a",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "97fb2163122f2701",
"type": "inject",
"z": "bf622e623503117a",
"name": "",
"props": [
{
"p": "selectRange",
"v": "A",
"vt": "str"
},
{
"p": "parts",
"v": "1",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 390,
"y": 240,
"wires": [
[
"9891ae51dfd0aa09"
]
]
},
{
"id": "867a84d97f76647f",
"type": "debug",
"z": "bf622e623503117a",
"name": "debug 5",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "selectRange",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1060,
"y": 380,
"wires": []
},
{
"id": "9891ae51dfd0aa09",
"type": "join",
"z": "bf622e623503117a",
"name": "",
"mode": "custom",
"build": "string",
"property": "selectRange",
"propertyType": "msg",
"key": "topic",
"joiner": "",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "4",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "num",
"reduceFixup": "",
"x": 650,
"y": 300,
"wires": [
[
"867a84d97f76647f",
"fca0a12ee625a425"
]
]
},
{
"id": "0d13f39b67bb5c1d",
"type": "inject",
"z": "bf622e623503117a",
"name": "",
"props": [
{
"p": "selectRange",
"v": "1",
"vt": "str"
},
{
"p": "parts",
"v": "2",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 390,
"y": 320,
"wires": [
[
"9891ae51dfd0aa09"
]
]
},
{
"id": "d32f317c32c90fd5",
"type": "inject",
"z": "bf622e623503117a",
"name": "",
"props": [
{
"p": "selectRange",
"v": ":A",
"vt": "str"
},
{
"p": "parts",
"v": "3",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 390,
"y": 400,
"wires": [
[
"9891ae51dfd0aa09"
]
]
},
{
"id": "0cbcdae59c6e13b5",
"type": "inject",
"z": "bf622e623503117a",
"name": "",
"props": [
{
"p": "selectRange",
"v": "22",
"vt": "str"
},
{
"p": "parts",
"v": "4",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 390,
"y": 460,
"wires": [
[
"9891ae51dfd0aa09"
]
]
},
{
"id": "fca0a12ee625a425",
"type": "change",
"z": "bf622e623503117a",
"name": "",
"rules": [
{
"t": "change",
"p": "selectRange",
"pt": "msg",
"from": "A",
"fromt": "str",
"to": "B",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 830,
"y": 460,
"wires": [
[
"9fec9f2af5cfda9b"
]
]
},
{
"id": "9fec9f2af5cfda9b",
"type": "debug",
"z": "bf622e623503117a",
"name": "debug 6",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "selectRange",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1060,
"y": 460,
"wires": []
}
]