0

We are trying to pull in some data from an outside source that serves JSON.

The structure of said json is like this:

[ { "name":"something", "desc":"some kind of desc.", "tags": [ { "order":"3", "displayName":"Tag1" }, { "order":"13", "displayName":"Tags 101" }, { "order":"28", "displayName":"Dogs" } ] }, ... ] 

We want to implode all tags.displayName values into one string. I'll use the body field as an example. In the UI, if you view the content, "body" would be:

Tag1|Tags 101|Dogs 

In the "fields" section of my migration source yml file:

name: tagsCollection label: "tagsCollection" selector: tags 

Then, in the process section of the YML file I've tried this:

body: plugin: concat delimiter: "|" source: - stepsCollection 

I've also looked into the iterator plugin. Nothing seems to click.

If I do this in the process section of the yml file:

body: stepsCollection 

body will be "Array" in the UX. So it is aware that there is an array in that var.

What am I missing?? Many thanks

1 Answer 1

0

The documentation examples of concat plugin use a flat, non-associative array of strings as source, you are trying to concat a nested array of JSON objects. You could try to subprocess your tags to only fetch/concat the displayName from them

1
  • How does this work? Example? Commented Mar 31, 2023 at 9:58

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.