Is there a way to log data within a Workflow so that it can be appended to a dataset?

I have a Workflow that is looping through invoices, building a table of line items, then sending out the invoices to relevant parties. With each email sent, I want to log the invoice number and the isSent=true variable (created in the Send External Email tile) to a dataset.

As it is now, I have the Append to Dataset tile within the loop logging this information; however, this means that the "Records" dataset gets updated ~300 times every time we send out invoices. That's a lot of credits.

Is there a way to create something in the Workflow that can log all the relevant rows and append them to a dataset once at the end of the Workflow? Something like creating a list of objects, having each invoice number and isSent log to that list, then appending the list of objects to a dataset. Are there existing tiles that can do what I want? Do I need to make a custom tile in code engine? Or is there another approach I could use that would serve the same purpose?

Tagged:

Answers

  • 1. Before the loop, create an empty List of Objects variable (invoiceLogList).

    2. Inside the loop, add to List of Objects

    • Define keys: invoiceNumber, isSent
    • Add each invoice's log info to invoiceLogList.

    3. After the loop ends, use the Append to Dataset tile.

    • Set invoiceLogList as the input.

    Now you're writing all the rows in one bulk operation.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **