How to write an array of struct to an Obj Set in AIP Logic

In AIP Logic, the loop of my LLM output is an array of struct (each element is a string), and I need to write that array to an Obj set, so it can create objects to an existing Obj Type. I can’t seem to be able to do that in AIP Logic. Can someone please advise? Thank you.

You should be able to use a loop in AIP logic such that for each element in your array you can call an action via an action block that will create an object in the ontology.

Alternatively, you can write an action backed by a function that takes a list of structs and creates the objects. You can then use the action block (without the loop) to modify the ontology.

Thanks for the response, @bkaplan! So for each element in the array, which is a struct- it’s supposed to be an object. I can’t call the action as the data types are not as expected. Please see screenshot. I’ll try the second option to see if it works. Can the function that takes the list of structs and creates the objects be written in AIP Logic? Or it has to be written in TypeScript?