Interpreting Script activity output json with Azure Data Factory\Synapse analytics
Script activity in Azure Data Factory\ Synapse analytics is very helpful to run queries against data sources mentioned here in this document.
When we use two or more queries in the script activity, it is important to understand the output json of script activity to write expressions based on the output in the subsequent activities.
Consider the below Pipeline design:
We have two select queries as follows in script activity, and each of which will give a resultSet.
select top 2 * from tbl_adf;
Select * from tbladf
When debugged, it will give output as below.
So, as per line #2, resultSet count =2. It is because, we have two select queries in the script activity.
In case we want to get the Total Revenue value from Row#1, we have to write below expression.
@activity('Script1_copy1').output.resultSets[0].rows[0]['Total Revenue']
where, resultSets[0]: First select query result
rows[0]: first row in resultSets[0]
Same way, if we want to get the Total Revenue value from Row#2, we have to write below expression.
@activity('Script1_copy1').output.resultSets[0].rows[1]['Total Revenue']
where, resultSets[0]: First select query result
rows[1]: second row in resultSets[0]
And, the below expression gets the rowcount from each resultset.
@activity('Script1_copy1').output.resultSets[0].RowCount
@activity('Script1_copy1').output.resultSets[1].RowCount
So, by understanding the structure of output json, we are able to write expressions to access individual elements of the output of any activity in ADF\Synapse.
Published on:
Learn moreRelated posts
Which Azure Cosmos DB Role Does My App Need?
In the previous post in the series, we covered the security decisions you make on day one. In this part, we will talk about how to give your a...
Find and fix app issues - Azure Copilot Observability Agent
Cut through alert noise and move from detection to root cause using the Azure Copilot Observability Agent. It autonomously investigates incide...
Azure Functions MCP Extension: What’s New at Build 2026
A roundup of what shipped in the Azure Functions MCP extension since preview: resource and prompt triggers, MCP Apps, built-in MCP authenticat...
Secure Boot certificate updates for Linux on Azure virtual machines
Microsoft has published new guidance for managing Secure Boot certificate updates for Linux on Azure virtual machines, including Trusted Launc...
Soluzione Earns Microsoft Solutions Partner Designation for Digital & App Innovation (Azure)
Soluzione is pleased to announce that it has earned the Microsoft Solutions Partner designation for Digital & App Innovation (Azure). This...
Azure SDK Release (May 2026)
Azure SDK releases every month. In this post, you'll find this month's highlights and release notes. The post Azure SDK Release (May 2026) app...
How to Use Deep Agents with Azure Cosmos DB – Plan, act, and verify against operational data
Deep Agents is an agent harness built on LangGraph, for agents that need to work through a task over many steps instead of a single LLM call. ...
Retirement of Azure DevOps issuer in Workload identity federation service connections
We are announcing the deprecation of the Azure DevOps issuer in workload identity federation (WIF) service connections, with planned retiremen...