How to capture logs, append them to a datatable/array, write rang to excel and email it

Hello!

I’ve been creating a Dynamics AX automation for a client which helps the employee dealing with orders being placed by clients. In order to keep control over which orders the robot has handled and which not (depends on some rules we have set up), I want to capture various logs. Then append these to some type of variable (datatable, array etc), then write that variable to a textfile/excel and email it to the process owner.

Below in a bit more schema form what I’m trying to accomplish:

For each log spit out by the robot:

Capture the Log → Assign it to variable → Add this variable as a new row in datatable

After the loop has finished:

Write datatable range/array to text/excel file → email that file to process owner once process is completed.

Ps: My client doesn’t have 20k to invest into an orchestrator license I’m afraid thus in order to keep somehow a bit of control over the robot by the process owner, this is the only decent way to do so I believe.

Ps 2: I have been doing quite some reading on this topic on this forum but the answers aren’t really helping me forward, hence this topic. All of the sources marked below aren’t helping me any further trying different approached (writing lines, capturing that variable, appending it to an array/writing it to a datatable etc)

Any help is highly appreciated.