I'm trying to loop through an array (called "Attributes") in a JSON migration source, but I can't figure out how to do it. Here's a shortened sample of my data source:
[
{
"Id": "ST00000002",
"Title": "Fast & Furious 9",
"Attributes": [
"0000000013",
"0000000015"
]
}
]
My ultimate goal is to check certain checkbox/boolean fields based on those attribute values, but I can't figure out how to handle each of the attributes individually.
Things I have tried so far:
- Using
single_value
andmultiple_values
- Using the custom
Deepen
process plugin (as seen on this issue) - Using
sub_process
- Using the
static_map
plugin (to do something like this:
map:
'0000000015': 1
default_value: 0
Using
skip_on_value
withnot_equals: true
Using countless combinations of the above functions
I feel like this can't possibly be as difficult as I'm making it, so I hope someone can help me out. Thank you so much.
concat
andstr_replace
+regex
option might do the trick, I would advise to create a process plugin that acts as a wrapper to PHP'sin_array