Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Use a batch macro to go through NDJSON file row by row

TH
8 - Asteroid

That's literally all I want to do.

I have a workflow that processes a single JSON row at a time. It produces a single output row at a time.

I also have an NDJSON file that contains multiple rows. Each is a single JSON record.

Because of the maneuvering of the data I have to process the NDJSON file by processing each row independently. I am not able to process *n* JSON records at once.

I literally just want to run my NDJSON file through the workflow one row at a time and tack each result row onto the bottom of the output.

The "Batch Macro" help says that that macro type goes through a file row by row and creates an output that appends the processed row to the bottom of the set of all the processed rows. All the examples, though, involve things like grouping or calculations based on fields or things like that.

And that's not what I want to do.

I just want to be able to
  hand the macro an NDJSON file with an arbitrary number of JSON records in it
  , have it process record 1 and generate an output

  ,have it process record 2, generate an output, and add that to the bottom of the table with record 1

  ,have it process record 3, generate an output, and add that to the bottom of the table with records 1 and 2

  and so forth...

 

How do I make this happen?

Is it super simple because it's what the batch macro is supposed to do anyway?
Or are there some intricacies to the structure and setup of the batch macro itself?

1 REPLY 1
MatthewO
Alteryx
Alteryx

Hello @TH

 

You are correct, a batch macro could accomplish this. In this case, I would recommend creating a record id field and using this as the grouping in the batch macro, so that each row executes independently. Below are some links that explain how to build a batch macro. 

 

Labels