Repeat items

Hi

I have a problem, I have several items under what you can see sectiontemplates, and under each section template, I do have many tasktemplates items, under each of those I have a number of data point i would like to add to the database. (see picture 1)

I would like to be able to extract data from each tasktemplates and generate a json output see (picture 2)

How do I make so I can repeat and add data from every tasktemplate?

Picture 1

Picture 2

Picture 3

Can you please copy the data the “Get checklist items” Node outputs and post it here.

{
  "status": 8,
  "approved": false,
  "locations": [
    "0b286d82-70b1-4e48-b7ce-544c3b922c38"
  ],
  "permissions": [],
  "onlyStartByApi": false,
  "refId": "test checklist 1",
  "shortDescription": "",
  "everybodyCanFinishChecklist": false,
  "metadata": [],
  "webhooks": [],
  "publishToMessagebus": false,
  "singleUserTemplate": false,
  "revisionUpdateTime": "2020-02-10T04:43:04.081Z",
  "revisionUpdateTimeString": "2020-02-10T04:43:04.0810000",
  "revision": 1,
  "reoccurring": false,
  "archiveChecklistsAfter": 3,
  "categories": null,
  "id": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
  "name": "test",
  "sectionTemplates": [
    {
      "name": "Test section 1",
      "color": "#607D8A",
      "documentation": [],
      "order": 0,
      "webhooks": [],
      "publishToMessagebus": false,
      "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
      "id": "f903649e-0dc3-4ac4-a803-df7c14c03d48",
      "taskTemplates": [
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "Food item 1",
          "documentation": [],
          "order": 0,
          "sectionId": "f903649e-0dc3-4ac4-a803-df7c14c03d48",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "a165e1d2-f96a-4492-8abb-b41ea895a218",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 0,
          "shouldConfirm": null
        },
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "food item 2",
          "documentation": [],
          "order": 1,
          "sectionId": "f903649e-0dc3-4ac4-a803-df7c14c03d48",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "b6a2c816-6588-422d-a0f3-6f6b6dd29b35",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 6,
          "shouldConfirm": null
        },
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "food item 3",
          "documentation": [],
          "order": 2,
          "sectionId": "f903649e-0dc3-4ac4-a803-df7c14c03d48",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "8de9879a-7158-4327-b577-2588ac559517",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 0,
          "shouldConfirm": null
        }
      ]
    },
    {
      "name": "Test section 2",
      "color": "#607D8A",
      "documentation": [],
      "order": 1,
      "webhooks": [],
      "publishToMessagebus": false,
      "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
      "id": "d95096a7-926a-4caa-a239-0ac857cf5171",
      "taskTemplates": [
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "drink item 1",
          "documentation": [],
          "order": 1,
          "sectionId": "d95096a7-926a-4caa-a239-0ac857cf5171",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "6ba8815f-539b-4c34-941f-d650270b8896",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 6,
          "shouldConfirm": null
        },
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "drink item 2",
          "documentation": [],
          "order": 2,
          "sectionId": "d95096a7-926a-4caa-a239-0ac857cf5171",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "05029248-037c-4e70-843b-8d0dfccbd359",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 6,
          "shouldConfirm": null
        },
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "drink item 3",
          "documentation": [],
          "order": 3,
          "sectionId": "d95096a7-926a-4caa-a239-0ac857cf5171",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "17e44d6d-7451-4315-a058-e9cf786395fc",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 6,
          "shouldConfirm": null
        }
      ]
    },
    {
      "name": "Test section 3",
      "color": "#607D8A",
      "documentation": [],
      "order": 2,
      "webhooks": [],
      "publishToMessagebus": false,
      "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
      "id": "afe13ee5-30fe-4f66-a6bc-c28fee46b387",
      "taskTemplates": [
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "sun item 1",
          "documentation": [],
          "order": 0,
          "sectionId": "afe13ee5-30fe-4f66-a6bc-c28fee46b387",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "2c1bb584-9d58-477c-8c9a-19a28267e4cf",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 6,
          "shouldConfirm": null
        },
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "sun item 2",
          "documentation": [],
          "order": 1,
          "sectionId": "afe13ee5-30fe-4f66-a6bc-c28fee46b387",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "754617cc-cfe4-47d4-b7e0-157f95716606",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 6,
          "shouldConfirm": null
        },
        {
          "templateId": "10b87ab4-504f-43a1-9df7-c5ff64dfcb47",
          "name": "sun item 3",
          "documentation": [],
          "order": 2,
          "sectionId": "afe13ee5-30fe-4f66-a6bc-c28fee46b387",
          "values": "",
          "values2": "",
          "secondaryTitle": "",
          "valueTitle": "",
          "valueTitle2": "",
          "tags": "",
          "analyticTags": "",
          "min": null,
          "max": null,
          "webhooks": [],
          "transferValueOnConsecutiveChecklist": false,
          "preventValueInThePast": false,
          "preventQuickInput": false,
          "publishToMessagebus": false,
          "publishToLoggingMessagebus": false,
          "metadata": [],
          "assignedPosition": null,
          "allowQuickDiscard": true,
          "id": "abeb3702-aa72-45a8-b7fc-e76cfe07bd42",
          "reminderHours": null,
          "reminderMinutes": null,
          "type": 6,
          "shouldConfirm": null
        }
      ]
    }
  ],
  "rules": {
    "hiddenByDefault": [],
    "rules": []
  }
}

Response headers

You can use this node. It splits out all the data as separate items:

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "const returnItems = [];\n\nconst sectionTemplates = items[0].json.sectionTemplates;\nfor (const sectionTemplate of sectionTemplates) { \n  for (const taskTemplate of sectionTemplate.taskTemplates) {\n    returnItems.push({json: taskTemplate});\n  }\n}\n\nreturn returnItems;"
      },
      "name": "Function1",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        550,
        300
      ]
    }
  ],
  "connections": {}
}

After it, you can then either use another Function-Node or probably even simpler just a Set-Node to create new items with only the data you need.

Thanks alot

I tired it but did not really got it to work but i guess it on my side

Did i make the right input for const returnItem

No best to not change the node all. It works great like that, no changes needed at all.

Add another node after it as written above. Best a Set-Node, on which you add only the properties you need and you activate “Keep Only Set”. Then you should have everything you need.

So just to be clear. You connect the node I did post to the HTTP Request-Node.

Thanks

I still have the problem that i cant get the next node to repeat. It only do the first item.

Ah yes, that is expected. You define only one item and so it returns also only just one. The Function-Node returns exactly the items you define. You can check out the documentation about the Function-Node here:
https://docs.n8n.io/#/nodes?id=function-and-function-item-node

For the above reason did I write to use a Set-Node. This one would take the data of each item and will work so as expected. As an alternative, you can also use the FunctionItem-Node. That one also executes for each item and so probably does what you want it to do.

Sadly can not find half of the information you did reference in your example in the data so can not give you a working example.

But looking at your code it seems like you to combine different data from different levels (section & task) so in that case, your best bet would really be to change the code of the Function-Node I did provide. It could then, for example, look like this:

const returnItems = [];

const sectionTemplates = items[0].json.sectionTemplates;
for (const sectionTemplate of sectionTemplates) { 
  for (const taskTemplate of sectionTemplate.taskTemplates) {
    returnItems.push({json: {
      mainId: items[0].json.id,
      sectionId: sectionTemplate.id,
      taskId: taskTemplate.id,
    }});
  }
}

return returnItems;

But you should then only change the code in the middle where it does the returnItems.push and define there the data you need to supply. Hope that helps!

Hi i keep on trying but does not get it to work

I have generated a set with all data as sample

here is a link to the document as it was to big for here

Very sorry but do not know what do do with that. The workflow contains two nodes of which each contains a lot of data and I do not know how they relate to each other. Like do they have to be joined depending on some kind of common key? If so which one?

Sorry for complicated i have updated and also try to add a little explanation

It is only node 3 get checklist items that should have repeating items all the others should remain static

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "const item= [\n{\n  json: {\n    \"ShortName\": \"RB\",\n    \"ActiveStation\": \"Singapore\",\n    \"EmergencyId\": \"7827225_Fire_202002101730\",\n    \"EmergencyTitle\": \"RB_Fire_202002101730\"\n}\n}\n];\n\nreturn item;\n"
      },
      "name": "Get Location data",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        900,
        290
      ]
    },
    {
      "parameters": {
        "functionCode": "const item= [\n{\n  json:\n  {\n  \"status\": 8,\n  \"approved\": false,\n  \"locations\": [\n    \"0b286d82-70b1-4e48-b7ce-544c3b922c38\"\n  ],\n  \"permissions\": [],\n  \"onlyStartByApi\": false,\n  \"refId\": \"test checklist 1\",\n  \"shortDescription\": \"\",\n  \"everybodyCanFinishChecklist\": false,\n  \"metadata\": [],\n  \"webhooks\": [],\n  \"publishToMessagebus\": false,\n  \"singleUserTemplate\": false,\n  \"revisionUpdateTime\": \"2020-02-10T04:43:04.081Z\",\n  \"revisionUpdateTimeString\": \"2020-02-10T04:43:04.0810000\",\n  \"revision\": 1,\n  \"reoccurring\": false,\n  \"archiveChecklistsAfter\": 3,\n  \"categories\": null,\n  \"id\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n  \"name\": \"test\",\n  \"sectionTemplates\": [\n    {\n      \"name\": \"Test section 1\",\n      \"color\": \"#607D8A\",\n      \"documentation\": [],\n      \"order\": 0,\n      \"webhooks\": [],\n      \"publishToMessagebus\": false,\n      \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n      \"id\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n      \"taskTemplates\": [\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"Food item 1\",\n          \"documentation\": [],\n          \"order\": 0,\n          \"sectionId\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"a165e1d2-f96a-4492-8abb-b41ea895a218\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 0,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"food item 2\",\n          \"documentation\": [],\n          \"order\": 1,\n          \"sectionId\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"b6a2c816-6588-422d-a0f3-6f6b6dd29b35\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"food item 3\",\n          \"documentation\": [],\n          \"order\": 2,\n          \"sectionId\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"8de9879a-7158-4327-b577-2588ac559517\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 0,\n          \"shouldConfirm\": null\n        }\n      ]\n    },\n    {\n      \"name\": \"Test section 2\",\n      \"color\": \"#607D8A\",\n      \"documentation\": [],\n      \"order\": 1,\n      \"webhooks\": [],\n      \"publishToMessagebus\": false,\n      \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n      \"id\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n      \"taskTemplates\": [\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"drink item 1\",\n          \"documentation\": [],\n          \"order\": 1,\n          \"sectionId\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"6ba8815f-539b-4c34-941f-d650270b8896\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"drink item 2\",\n          \"documentation\": [],\n          \"order\": 2,\n          \"sectionId\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"05029248-037c-4e70-843b-8d0dfccbd359\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"drink item 3\",\n          \"documentation\": [],\n          \"order\": 3,\n          \"sectionId\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"17e44d6d-7451-4315-a058-e9cf786395fc\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        }\n      ]\n    },\n    {\n      \"name\": \"Test section 3\",\n      \"color\": \"#607D8A\",\n      \"documentation\": [],\n      \"order\": 2,\n      \"webhooks\": [],\n      \"publishToMessagebus\": false,\n      \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n      \"id\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n      \"taskTemplates\": [\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"sun item 1\",\n          \"documentation\": [],\n          \"order\": 0,\n          \"sectionId\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"2c1bb584-9d58-477c-8c9a-19a28267e4cf\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"sun item 2\",\n          \"documentation\": [],\n          \"order\": 1,\n          \"sectionId\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"754617cc-cfe4-47d4-b7e0-157f95716606\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"sun item 3\",\n          \"documentation\": [],\n          \"order\": 2,\n          \"sectionId\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"abeb3702-aa72-45a8-b7fc-e76cfe07bd42\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        }\n      ]\n    }\n  ],\n  \"rules\": {\n    \"hiddenByDefault\": [],\n    \"rules\": []\n  }\n}\n      \n\n}\n];\n\nreturn item;\n"
      },
      "name": "Get checklist items",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1410,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const item= [\n{\n  json: {\n  \"Id\": \"1234\",\n  \"LocationId\": \"1234\"\n}\n}\n];\n\nreturn item;\n"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        590,
        280
      ]
    }
  ],
  "connections": {
    "Get Location data": {
      "main": [
        [
          {
            "node": "Get checklist items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Get Location data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Ok, this does not add all the fields you need but gives an example for each of them that you should be able to figure out the rest:

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "const item= [\n{\n  json: {\n    \"ShortName\": \"RB\",\n    \"ActiveStation\": \"Singapore\",\n    \"EmergencyId\": \"7827225_Fire_202002101730\",\n    \"EmergencyTitle\": \"RB_Fire_202002101730\"\n}\n}\n];\n\nreturn item;\n"
      },
      "name": "Get Location data",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        950,
        600
      ]
    },
    {
      "parameters": {
        "functionCode": "const item= [\n{\n  json:\n  {\n  \"status\": 8,\n  \"approved\": false,\n  \"locations\": [\n    \"0b286d82-70b1-4e48-b7ce-544c3b922c38\"\n  ],\n  \"permissions\": [],\n  \"onlyStartByApi\": false,\n  \"refId\": \"test checklist 1\",\n  \"shortDescription\": \"\",\n  \"everybodyCanFinishChecklist\": false,\n  \"metadata\": [],\n  \"webhooks\": [],\n  \"publishToMessagebus\": false,\n  \"singleUserTemplate\": false,\n  \"revisionUpdateTime\": \"2020-02-10T04:43:04.081Z\",\n  \"revisionUpdateTimeString\": \"2020-02-10T04:43:04.0810000\",\n  \"revision\": 1,\n  \"reoccurring\": false,\n  \"archiveChecklistsAfter\": 3,\n  \"categories\": null,\n  \"id\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n  \"name\": \"test\",\n  \"sectionTemplates\": [\n    {\n      \"name\": \"Test section 1\",\n      \"color\": \"#607D8A\",\n      \"documentation\": [],\n      \"order\": 0,\n      \"webhooks\": [],\n      \"publishToMessagebus\": false,\n      \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n      \"id\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n      \"taskTemplates\": [\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"Food item 1\",\n          \"documentation\": [],\n          \"order\": 0,\n          \"sectionId\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"a165e1d2-f96a-4492-8abb-b41ea895a218\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 0,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"food item 2\",\n          \"documentation\": [],\n          \"order\": 1,\n          \"sectionId\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"b6a2c816-6588-422d-a0f3-6f6b6dd29b35\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"food item 3\",\n          \"documentation\": [],\n          \"order\": 2,\n          \"sectionId\": \"f903649e-0dc3-4ac4-a803-df7c14c03d48\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"8de9879a-7158-4327-b577-2588ac559517\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 0,\n          \"shouldConfirm\": null\n        }\n      ]\n    },\n    {\n      \"name\": \"Test section 2\",\n      \"color\": \"#607D8A\",\n      \"documentation\": [],\n      \"order\": 1,\n      \"webhooks\": [],\n      \"publishToMessagebus\": false,\n      \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n      \"id\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n      \"taskTemplates\": [\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"drink item 1\",\n          \"documentation\": [],\n          \"order\": 1,\n          \"sectionId\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"6ba8815f-539b-4c34-941f-d650270b8896\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"drink item 2\",\n          \"documentation\": [],\n          \"order\": 2,\n          \"sectionId\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"05029248-037c-4e70-843b-8d0dfccbd359\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"drink item 3\",\n          \"documentation\": [],\n          \"order\": 3,\n          \"sectionId\": \"d95096a7-926a-4caa-a239-0ac857cf5171\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"17e44d6d-7451-4315-a058-e9cf786395fc\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        }\n      ]\n    },\n    {\n      \"name\": \"Test section 3\",\n      \"color\": \"#607D8A\",\n      \"documentation\": [],\n      \"order\": 2,\n      \"webhooks\": [],\n      \"publishToMessagebus\": false,\n      \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n      \"id\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n      \"taskTemplates\": [\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"sun item 1\",\n          \"documentation\": [],\n          \"order\": 0,\n          \"sectionId\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"2c1bb584-9d58-477c-8c9a-19a28267e4cf\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"sun item 2\",\n          \"documentation\": [],\n          \"order\": 1,\n          \"sectionId\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"754617cc-cfe4-47d4-b7e0-157f95716606\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        },\n        {\n          \"templateId\": \"10b87ab4-504f-43a1-9df7-c5ff64dfcb47\",\n          \"name\": \"sun item 3\",\n          \"documentation\": [],\n          \"order\": 2,\n          \"sectionId\": \"afe13ee5-30fe-4f66-a6bc-c28fee46b387\",\n          \"values\": \"\",\n          \"values2\": \"\",\n          \"secondaryTitle\": \"\",\n          \"valueTitle\": \"\",\n          \"valueTitle2\": \"\",\n          \"tags\": \"\",\n          \"analyticTags\": \"\",\n          \"min\": null,\n          \"max\": null,\n          \"webhooks\": [],\n          \"transferValueOnConsecutiveChecklist\": false,\n          \"preventValueInThePast\": false,\n          \"preventQuickInput\": false,\n          \"publishToMessagebus\": false,\n          \"publishToLoggingMessagebus\": false,\n          \"metadata\": [],\n          \"assignedPosition\": null,\n          \"allowQuickDiscard\": true,\n          \"id\": \"abeb3702-aa72-45a8-b7fc-e76cfe07bd42\",\n          \"reminderHours\": null,\n          \"reminderMinutes\": null,\n          \"type\": 6,\n          \"shouldConfirm\": null\n        }\n      ]\n    }\n  ],\n  \"rules\": {\n    \"hiddenByDefault\": [],\n    \"rules\": []\n  }\n}\n      \n\n}\n];\n\nreturn item;\n"
      },
      "name": "Get checklist items",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1150,
        600
      ]
    },
    {
      "parameters": {
        "functionCode": "const item= [\n{\n  json: {\n  \"Id\": \"1234\",\n  \"LocationId\": \"1234\"\n}\n}\n];\n\nreturn item;\n"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        750,
        600
      ]
    },
    {
      "parameters": {
        "functionCode": "const returnItems = [];\n\nconst sectionTemplates = items[0].json.sectionTemplates;\nfor (const sectionTemplate of sectionTemplates) { \n  for (const taskTemplate of sectionTemplate.taskTemplates) {\n    returnItems.push({json: {\n      locationId:  $item(0).$node[\"Webhook\"].data[\"LocationId\"],\n      emergencyId: $item(0).$node[\"Get Location data\"].data[\"EmergencyId\"],\n      checklisttitle: $item(0).$node[\"Get checklist items\"].data[\"name\"],\n      itemTitle: taskTemplate.name,\n    }});\n  }\n}\n\nreturn returnItems;"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1350,
        600
      ]
    }
  ],
  "connections": {
    "Get Location data": {
      "main": [
        [
          {
            "node": "Get checklist items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get checklist items": {
      "main": [
        [
          {
            "node": "Function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Get Location data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Thank you

Manage to test it and works great.

Thanks for all help

That is great to hear! Have fun!