How to access failure output if output is like this?

Shreyash Choudhary 126 Reputation points
2023-02-14T08:19:26.6633333+00:00

User's image

i want to log this message (above) , i have used activity.output thing in expression but its getting failed saying invalid template , i have used @if(activity('abcd').output.error.message,activity('abcd').output.error.message,activity('abcd').output)

can anyone help, i want to capture any kind of error via expression ,please provide expression.

also when i used activity('abcd').output , this text got inserted in Database ->

system.collections.generic.dictionary.~2[System.string.system.object]

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
0 comments No comments
{count} votes

Answer accepted by question author
  1. MartinJaffer-MSFT 26,161 Reputation points
    2023-02-14T21:37:30.98+00:00

    @Shreyash Choudhary Hello and welcome to Microsoft Q&A.

    As I understand you are having difficulty getting error message. You used activity('abcd').output.error.message

    Error is not part of output. You need to use:

    activity('abcd').error.message

    I have made this mistake myself plenty of times. Output and Error (when present) both are complex objects. The properties have named keys, not positional keys, and this is why you got "system.collections.generic.dictionary". If you want to see the whole thing, I recommend converting to string first. This forces the whole object to resolve.

    When troubleshooting I often use @{activity('abcd')}. Then I copy the result to a text editor and clean it up (the result gets escaped ("->\").


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.