Skip to content

CustomActivity datatable output #5368

Answered by glime-ai bot
guidoDimasi asked this question in Q&A
Discussion options

You must be logged in to vote

In Elsa 3.1, when you create a custom activity that executes a SQL query and stores the results in a DataTable, you have several options for outputting the data to the workflow. JSON is a common and flexible format for serializing data, and it can be easily consumed by other activities in the workflow.

To output the data as JSON, you would typically serialize the DataTable to a JSON string. Here's a general approach you could take:

  1. Execute your SQL query and store the results in a DataTable.
  2. Serialize the DataTable to JSON. You can use a library like Newtonsoft.Json (Json.NET) or System.Text.Json for serialization.
  3. Set the serialized JSON string as the output of your activity.

Here's a …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by guidoDimasi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant