I have a flow that works most of the time. When the email subject line has 4 array items, it runs no issue. But I do have some subject lines that are shorter and that's when the flow fails.
Looking for a better work around so that the flow will ignore CustName4 variable and output later in my flow if it's null, blank, outside the bounds (0,3) of array, etc.
I have several splits setup to pull out just the pieces I need from the Subject Line and I have a filter on the trigger also.
Happy to try to show my workflow if that helps.
Any thoughts or work arounds would be greatly appreciated.
Here's the error message I get and the Code view.
InvalidTemplate
Unable to process template language expressions in action 'CustName4' inputs at line '0' and column '0': 'The template language expression 'outputs('Further_Split_for_customer_num_Name')[4]' cannot be evaluated because array index '4' is outside bounds (0, 3) of array. Please see https://aka.ms/logicexpressions for usage details.'.
Code View:
{
"type": "InitializeVariable",
"inputs": {
"variables": [
{
"name": "CustName4",
"type": "string",
"value": "@{outputs('Further_Split_for_customer_num_Name')[4]}"
}
]
},
"runAfter": {
"CustNme3": [
"Succeeded",
"TimedOut",
"Skipped",
"Failed"
]
},
"metadata": {
"operationMetadataId": "2b22ddea-ff75-4496-b8e5-8352c9bcdf05"
}
}