locked
IF Condition always fails RRS feed

  • Question

  •  I have tried to use the IF Condition and it always return failure with code 400 and the message “Activity failed because an inner activity failed”.   Even i just use very simple activities inside the IF Condition sub-activities like look-up or run a sp it still end with the same error.

    Monday, April 23, 2018 4:36 AM

All replies

  • Hi Harry,

    Could you provide a code example of one of your failing IF statements which should evaluate to true?

    Tuesday, May 1, 2018 6:08 PM
  • Hi, below is my pipeline code,  when i run it always fail at the IF Condition with code 400 and the message “Activity failed because an inner activity failed”. 

    ------------------------

    {
    "name": "pipeline2",
    "properties": {
    "activities": [
    {
    "name": "If Condition1",
    "type": "IfCondition",
    "dependsOn": [
    {
    "activity": "Lookup1",
    "dependencyConditions": [
    "Succeeded"
    ]
    }
    ],
    "typeProperties": {
    "expression": {
    "value": "greater(@activity('Lookup1').output.LastUpdated , utcnow())",
    "type": "Expression"
    },
    "ifFalseActivities": [
    {
    "name": "Stored Procedure2",
    "type": "SqlServerStoredProcedure",
    "policy": {
    "timeout": "7.00:00:00",
    "retry": 0,
    "retryIntervalInSeconds": 30,
    "secureOutput": false
    },
    "typeProperties": {
    "storedProcedureName": "[dbo].[p_test]"
    },
    "linkedServiceName": {
    "referenceName": "ANLDB_FP_DEV",
    "type": "LinkedServiceReference"
    }
    }
    ],
    "ifTrueActivities": [
    {
    "name": "Execute Pipeline1",
    "type": "ExecutePipeline",
    "typeProperties": {
    "pipeline": {
    "referenceName": "pipeline1",
    "type": "PipelineReference"
    }
    }
    }
    ]
    }
    },
    {
    "name": "Lookup1",
    "type": "Lookup",
    "policy": {
    "timeout": "7.00:00:00",
    "retry": 0,
    "retryIntervalInSeconds": 30,
    "secureOutput": false
    },
    "typeProperties": {
    "source": {
    "type": "SqlSource"
    },
    "dataset": {
    "referenceName": "CheckUpdateTable",
    "type": "DatasetReference"
    }
    }
    }
    ],
    "parameters": {
    "RunMaster": {
    "type": "Int",
    "defaultValue": 0
    }
    }
    }
    }

    Wednesday, May 9, 2018 8:28 AM