You could try this:
[
{
"id": "d4384525475d2051",
"type": "sf:949541c9b70110d5",
"z": "9761e3d04587c4ce",
"name": "",
"API": "asset/animal",
"Method": "GET",
"x": 110,
"y": 500,
"wires": [
[
"2c0bde5aa867661a"
]
]
},
{
"id": "1b4ed8658d016049",
"type": "inject",
"z": "9761e3d04587c4ce",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 120,
"y": 420,
"wires": [
[
"4ac6156a5531d2af"
]
]
},
{
"id": "d67c9a1d34d1445f",
"type": "split",
"z": "9761e3d04587c4ce",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 430,
"y": 500,
"wires": [
[
"8a54399e21d1a83c"
]
]
},
{
"id": "8a54399e21d1a83c",
"type": "split",
"z": "9761e3d04587c4ce",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 550,
"y": 500,
"wires": [
[
"db0df28a61ba1df9"
]
]
},
{
"id": "db0df28a61ba1df9",
"type": "switch",
"z": "9761e3d04587c4ce",
"name": "Filter animals",
"property": "payload.attributes.flag",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "monitor",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 700,
"y": 500,
"wires": [
[
"9e0fa6fb5b7dc62b"
]
]
},
{
"id": "9e0fa6fb5b7dc62b",
"type": "change",
"z": "9761e3d04587c4ce",
"name": "",
"rules": [
{
"t": "set",
"p": "options",
"pt": "msg",
"to": "payload.attributes.name",
"tot": "msg"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.payload.id",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 880,
"y": 500,
"wires": [
[
"cf287a9f2c469279"
]
]
},
{
"id": "2f8b34fa993266d9",
"type": "debug",
"z": "9761e3d04587c4ce",
"name": "debug 68",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1020,
"y": 440,
"wires": []
},
{
"id": "e0ae85f360f9fdc2",
"type": "function",
"z": "9761e3d04587c4ce",
"name": "function 18",
"func": "msg.options = [msg.payload.options];\nvar aID = flow.get(\"animalID\") || [];\nfor (var i = 0; i < msg.payload.length; i++) {\n msg.options[i] = msg.payload[i].options\n msg.payload[i] = msg.payload[i].payload.id\n aID[i] = msg.payload[i];\n}\nflow.set(\"animalID\", aID)\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1190,
"y": 500,
"wires": [
[
"c2a87e3565e05dbd",
"8207a9ac9358fec7"
]
]
},
{
"id": "c2a87e3565e05dbd",
"type": "debug",
"z": "9761e3d04587c4ce",
"name": "debug 69",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1220,
"y": 440,
"wires": []
},
{
"id": "8207a9ac9358fec7",
"type": "ui_dropdown",
"z": "9761e3d04587c4ce",
"name": "",
"label": "",
"tooltip": "",
"place": "",
"group": "e396e7e9f5db9aaa",
"order": 0,
"width": 0,
"height": 0,
"passthru": false,
"multiple": false,
"options": [],
"payload": "",
"topic": "",
"topicType": "str",
"className": "",
"x": 400,
"y": 580,
"wires": [
[
"5e424d5b6f44d789",
"c41ba247bce535b3"
]
]
},
{
"id": "5e424d5b6f44d789",
"type": "debug",
"z": "9761e3d04587c4ce",
"name": "debug 70",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 560,
"y": 580,
"wires": []
},
{
"id": "cf287a9f2c469279",
"type": "merge",
"z": "9761e3d04587c4ce",
"name": "",
"timeout": "0",
"x": 1030,
"y": 500,
"wires": [
[
"2f8b34fa993266d9",
"e0ae85f360f9fdc2"
]
]
},
{
"id": "2c0bde5aa867661a",
"type": "function",
"z": "9761e3d04587c4ce",
"name": "Save id's",
"func": "var array = flow.get('Animals') || [];\nvar name;\nvar id;\n\nmsg.payload.data.forEach(data => {\nname = data.attributes.name;\nid = data.id;\narray.push({id:id,name:name});\n})\n\nflow.set(\"Animals\", array);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 280,
"y": 500,
"wires": [
[
"d67c9a1d34d1445f"
]
]
},
{
"id": "4ac6156a5531d2af",
"type": "change",
"z": "9761e3d04587c4ce",
"name": "",
"rules": [
{
"t": "delete",
"p": "Animals",
"pt": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 290,
"y": 420,
"wires": [
[
"d4384525475d2051"
]
]
},
{
"id": "c41ba247bce535b3",
"type": "function",
"z": "9761e3d04587c4ce",
"name": "",
"func": "var animals = flow.get(\"Animals\");\nvar name = msg.payload;\nvar array = [];\nvar id;\n\nanimals.forEach(data => {\n if (data.name == name) {\n id = data.id;\n }\n })\n\narray.push({id:id,name:name});\n\nmsg.payload = array;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 560,
"y": 640,
"wires": [
[
"4b5de9c569fa3567"
]
]
},
{
"id": "4b5de9c569fa3567",
"type": "debug",
"z": "9761e3d04587c4ce",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 640,
"wires": []
},
{
"id": "e396e7e9f5db9aaa",
"type": "ui_group",
"name": "Farmos",
"tab": "169f5145902ec68e",
"order": 3,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "169f5145902ec68e",
"type": "ui_tab",
"name": "FarmOS div",
"icon": "fa-leaf",
"order": 4,
"disabled": false,
"hidden": false
}
]