Hi!
How to display values as an array:
“tax_input-any 1”: [“value 1”, “value 2”],
“tax_input-any 2”: [“value 1”, “value 2”],
“tax_input-any 3”: [“value 1”, “value 2”]
And leave everything “meta_input - ***” as is.
Original code from Function node:
const result = []; for (const item of items) { const json = item.json; let taxInputs = {}; let metaInputs = {}; for (const key of Object.keys(json)) { if (key.includes('tax_input') && key !== 'tax_input') { taxInputs[key] = json[key]; } if (key.includes('meta_input') && key !== 'meta_input') { metaInputs[key] = json[key]; } } result.push({ json: { action: "create_post", post_title: json['post_title'], post_status: json['post_status'], post_type: json['post_type'], tax_input: taxInputs, meta_input: metaInputs, } }) taxInputs = []; metaInputs = {}; return result }