Workflow loop on Aray of JSON

Hi gliders!
Am stucking within days in a workflow loop on array of JSON, it doesn’t work(
Seems there is some mistake or limitation in organizing of such loop)
Usecase is I store the Audit Answers in Multiple Files Column (MFC) as an Array of JSON items per each Question of Audit. So there is one row per Audit with stored doughter items (Answers) by Array of (JSON per each Question+It’sAnswer).
I need sometime to rollout this Array of items (Question with Answer) to many rows into helper table for Reporting.
Trying to use a Workflow Loop on source of this Array - trying as MFC and as Make Array Column from it, but both source does not work in the loop unfortunately.
Seems the reason is similar to the past issues i have with a loop Storing and changing values to a variable in webhook Action. Just the difference is we have iteration by stored Array now, not by Rows as we had have that time. That @ThinDinh’s solution works well with Rows, but how to work with Array here?
:thinking:
So the questions

  • What should be the better source of this Loop (MFC \ JSON Array \ …)?
  • How to get the i-th item of such Source (MFC\JSON_Array) as iteration inside this loop to made Add Rows by each item of Array?
    Thank you in advance :folded_hands:
    ===
    Example of MFC for one row, in JSON here:
    {
    [{“rowid”:“hwrqL4bUSFGo5JRLeHk.ow”,“quest”:“What is your first name”,“answer”:“Edgar”},
    {“rowid”:“DQEawGxnRIq7OBJWM2dsPQ”,“quest”:“What is your position”,“answer”:“CIO”}]
    }

I’m curious. If you’re using this with a Helper table, why do you need to add rows?

Normally the way you would do this is start with enough empty rows in the helper table that you need, bring the array into the helper table, unwind it using the miracle method, and then build out the reporting logic.

It should all be completely dynamic without the need to ever be adding or removing rows.

1 Like

Mmm, seems interesting, thank you very much @Darren_Murphy, going to do this.
Probably looping is too hard thing to use with JSON yet(?

No, it’s quite possible. But it seems to me it’s not necessary in your use case?

However, the difficulty is that we have dozens of audits conducted, for example, 50, eg, with 40 questions each. But could be even 200x50 or more, so we need counted but hard unpredictable quantity of rows in helper table.
Would be the idea with empty lines remain optimal here?
And would be the Miracle Method works well with such size of an array?

As long as you don’t cross 1 million characters, I think you’ll be fine.

Just add a big enough number of rows, I think.

2 Likes