Hi @Mike Kiser ,
I think you need a FORLOOP after lookup activity and check if there is any pensionCode present in the activity('Lookup Job Codes for NO Pension').output.value, if yes, set variable to true/false. Hope this helps!
Thanks!
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello!
I just ran into a bug in our ADF Pipeline; I am getting the following returned in a Lookup Activity;
I have worked on this for hours. My questions are:
1) what is causing some of the items to have a /r/n after them when there are no spaces in the DB Table
2) I need the logic to say, if the employee does not have a job code in the list below, then I want the process to go to an IF Condition where true means that he gets a Pension and False means he gets nothing. So far my If Condition Activity Expression is:
@hamed1374 (equals(activity('Lookup Job Codes for NO Pension').output , NULL))
but that logic isn't working. Can you please assist? Please see screenshot.
I need to get this back into QA Testing...thanks!! MIke Kiser
@Nasreen Akter @HimanshuSinha-msft @MartinJaffer-MSFT
{
"count": 14,
"value": [
{
"PensionEligable": "C3001"
},
{
"PensionEligable": "CL0099\r\n"
},
{
"PensionEligable": "2711"
},
{
"PensionEligable": "2320C"
},
{
"PensionEligable": "2704\r\n"
},
{
"PensionEligable": "C9504"
},
{
"PensionEligable": "C6067"
},
{
"PensionEligable": "C6068"
},
{
"PensionEligable": "BNT"
},
{
"PensionEligable": "C9500"
},
{
"PensionEligable": "C9502"
},
{
"PensionEligable": "C6094\r\n"
},
{
"PensionEligable": "C9506\r\n"
},
{
Hi @Mike Kiser ,
I think you need a FORLOOP after lookup activity and check if there is any pensionCode present in the activity('Lookup Job Codes for NO Pension').output.value, if yes, set variable to true/false. Hope this helps!
Thanks!
See this example
{
"name": "CleanAndTest",
"properties": {
"activities": [
{
"name": "input",
"description": " { \"PensionEligable\": \"C3001\" }, { \"PensionEligable\": \"CL0099\\r\\n\" }, { \"PensionEligable\": \"2711\" }, { \"PensionEligable\": \"2320C\" }, { \"PensionEligable\": \"2704\\r\\n\" }, { \"PensionEligable\": \"C9504\" }, { \"PensionEligable\": \"C6067\" }, { \"PensionEligable\": \"C6068\" }, { \"PensionEligable\": \"BNT\" }, { \"PensionEligable\": \"C9500\" }, { \"PensionEligable\": \"C9502\" }, { \"PensionEligable\": \"C6094\\r\\n\" }, { \"PensionEligable\": \"C9506\\r\\n\" }",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "input",
"value": [
{
"PensionEligable": "C3001"
},
{
"PensionEligable": "CL0099\r\n"
},
{
"PensionEligable": "2711"
},
{
"PensionEligable": "2320C"
},
{
"PensionEligable": "2704\r\n"
},
{
"PensionEligable": "C9504"
},
{
"PensionEligable": "C6067"
},
{
"PensionEligable": "C6068"
},
{
"PensionEligable": "BNT"
},
{
"PensionEligable": "C9500"
},
{
"PensionEligable": "C9502"
},
{
"PensionEligable": "C6094\r\n"
},
{
"PensionEligable": "C9506\r\n"
}
]
}
},
{
"name": "Clean values",
"type": "ForEach",
"dependsOn": [
{
"activity": "input",
"dependencyConditions": [
"Succeeded"
]
}
],
"userProperties": [],
"typeProperties": {
"items": {
"value": "@variables('input')",
"type": "Expression"
},
"activities": [
{
"name": "Append variable1",
"type": "AppendVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "cleaned",
"value": {
"value": "@trim(item().PensionEligable)",
"type": "Expression"
}
}
}
]
}
},
{
"name": "If Condition1",
"type": "IfCondition",
"dependsOn": [
{
"activity": "Clean values",
"dependencyConditions": [
"Succeeded"
]
}
],
"userProperties": [],
"typeProperties": {
"expression": {
"value": "@contains(variables('cleaned'),pipeline().parameters.testvalue)",
"type": "Expression"
},
"ifFalseActivities": [
{
"name": "Value not found",
"type": "Wait",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
}
],
"ifTrueActivities": [
{
"name": "Value Found",
"type": "Wait",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
}
]
}
}
],
"parameters": {
"testvalue": {
"type": "string",
"defaultValue": "2704"
}
},
"variables": {
"input": {
"type": "Array",
"defaultValue": [
{
"PensionEligable": "C3001"
},
{
"PensionEligable": "CL0099\r\n"
},
{
"PensionEligable": "2711"
},
{
"PensionEligable": "2320C"
},
{
"PensionEligable": "2704\r\n"
},
{
"PensionEligable": "C9504"
},
{
"PensionEligable": "C6067"
},
{
"PensionEligable": "C6068"
},
{
"PensionEligable": "BNT"
},
{
"PensionEligable": "C9500"
},
{
"PensionEligable": "C9502"
},
{
"PensionEligable": "C6094\r\n"
},
{
"PensionEligable": "C9506\r\n"
}
]
},
"cleaned": {
"type": "Array"
}
},
"annotations": []
}
}