I am running the flow during the test and it works at perfectly and does all the action steps. When I launch the flow live, the flow fails and gives the following message but I don't understand because in the test it works perfect every time.
Unable to process template language expressions in action 'PartNumber' inputs at line '0' and column '0': 'The template language expression 'split(body('Filter_array')[3], '-')[1]' cannot be evaluated because array index '3' is outside bounds (0, 2) of array. Please see https://aka.ms/logicexpressions for usage details.'.
Hi @Anonymous & @Sundeep_Malik,
It might be good to know that index numbering starts with a [0] for the first item, [1] for the second item, [2] for the third item, etc.
In your original expression your were referring to item number 4 aka [3] (which does not exist). That's why your are getting an outside bounds error.
Looking at your example data below, you want to retrieve 416876 Line from the second item, correct?
[
"The Product Group has been changed on the following Sales Order and Line. SO -",
"416876 Line - 20 Part - 054140 New Product Group - CA_MFG Cust ID - 1729",
"Customer - NCC INDUSTRY AB (SWEDEN)"
]
In that case it would probably be [1] for the second item, and [0] for the first part of the split.
split(body('Filter_array')[1], '-')[0]
Hope this helps a bit?
Hi @Anonymous ,
You are getting above error because array index is outside bounds of array.
For example, lets take input value 'Power - Automate - Desktop' and apply split expression with separator '-'. Now the input value will split in to 3 sub text. Power , Automate and Desktop. Here the lower bound is 0 and upper bound is 2. So if i want to extract Automate then my expression would be outputs('Compose')[1]. But will get error for index value 3.
Sample Flow for your reference.
Kindly, check your input value and update the expression based on it.
If you like my response, please give it a Thumbs Up.
If this helps, please Accept as solution.
Regards
Kaif
This is the input data off the HTML to text:
The Product Group has been changed on the following Sales Order and Line.
SO - 416876
Line - 20
Part - 054140
New Product Group - CA_MFG
Cust ID - 1729
Customer - NCC INDUSTRY AB (SWEDEN)
This is the Outputs Data:
The Product Group has been changed on the following Sales Order and Line. SO -
416876 Line - 20 Part - 054140 New Product Group - CA_MFG Cust ID - 1729
Customer - NCC INDUSTRY AB (SWEDEN)
in the Filter array this is the input data:
@Anonymous
So, like you are getting the following data in the email:
Name ABC
Email. ABC.com
So, I want you to just give me a test data or example data of whatever you are getting in the output of html to text action.
Exactly same syntax in both the cases. Let's see if there are any differences.
Hey @Anonymous
Can you show the data that's coming after html to text in both cases
Not the real data but like,
If name is there, so write ABC,
Email: abc@gmail.com
Maybe there are some changes in the input.
Btw the video you watched it from, the creator of it, will give a solution in a few days. So follow that previous post, if I am not able to answer you.
These are the screen shots of the flow,
When I run it in testing, the flow is perfect and it does as designed to do. But when I run it on live, the triggers comes up with the error message as shown in the pictures. It saying index 3 is outside bonds (0,2) of array.
but I don't understand why because in the test it works just fine and no errors on the flow checker
@Anonymous
In the mean time share something more so I can help. Like what are you doing[Whole Process], some flow screenshots.
Also both run flows side by side to see differences, maybe.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional