Data Factory Use Cases
Execute JavaScript code to read and manipulate JSON and text data sources
This example provides an exhaustive list of code execution scenarios using JavaScript.
Takeaway
This example is based on a demo job.
Prerequisites
To execute this use case, you need:
- A Product-Live account with access to the Data Factory platform
Data Factory Job details
TIP
The job presented here is very basic and is intended to illustrate the process of executing JavaScript code. It can be enhanced and enriched to suit your needs. For more information, please refer to the Data Factory platform documentation.
mermaid
flowchart TD
_start(("Start"))
_end(("End"))
code_execute_javascript_response_json_value["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Return a JSON value"]
code_execute_javascript_response_json_object["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Return a JSON object"]
code_execute_javascript_response_file_txt["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Return a TXT file"]
code_execute_javascript_response_file_xml["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Return a XML file"]
code_execute_javascript_response_file_json["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Return a JSON file"]
code_execute_javascript_file_input_response_file_json["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Return a JSON file from a file input"]
code_execute_javascript_read_resources["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Read resources and return a JSON file"]
_start --> code_execute_javascript_response_json_value
code_execute_javascript_response_json_value --> code_execute_javascript_response_json_object
code_execute_javascript_response_json_object --> code_execute_javascript_response_file_txt
code_execute_javascript_response_file_txt --> code_execute_javascript_response_file_xml
code_execute_javascript_response_file_xml --> code_execute_javascript_response_file_json
code_execute_javascript_response_file_json --> code_execute_javascript_file_input_response_file_json
code_execute_javascript_file_input_response_file_json --> code_execute_javascript_read_resources
code_execute_javascript_read_resources --> _end