I'm setting up a migration from an URL with JSON on it.
Got the first level values without any issues. Currently I'm stuck at nested arrays which resemble something like this:
{ "content": [
{
"id": 148,
"hardwares": [
{
"hwId": 16,
"products": [
{
"pid": 2097,
"productName": "ProductName1",
},
{
"pid": 2100,
"productName": "ProductName2",
},
{
"pid": 2103,
"productName": "ProductName3",
},
{
"pid": 2094,
"productName": "ProductName4",
}
]
}
]
},
],
}
I have a custom content entity with a text field called Product Names, the field is a multi-value field. I've been trying to get the productName
values and populate the field. Basically this JSON here would create one entity, and then get the value by this hierarchy:
hardwares->products->productName
I can't seem to grasp the usage of the sub_process plugin and I would really appreciate any hints or any working examples.