cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FLOWMASTER3000
New Member

FLOW ERROR

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.'.

11 REPLIES 11
Sundeep_Malik
Community Champion
Community Champion

Sundeep_Malik
Community Champion
Community Champion

@FLOWMASTER3000 

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. 

FLOWMASTER3000_0-1663869868359.pngFLOWMASTER3000_1-1663869892368.pngFLOWMASTER3000_2-1663869909073.png

 

FLOWMASTER3000
New Member

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

Sundeep_Malik
Community Champion
Community Champion

Hey @FLOWMASTER3000 

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.

 

 

FLOWMASTER3000
New Member

@Sundeep_Malik sorry I don't follow what you are asking me to do?

Sundeep_Malik
Community Champion
Community Champion

@FLOWMASTER3000 

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.

FLOWMASTER3000
New Member

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:

[
  "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 for filter array:
[
  "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)"
]

 

 

Sundeep_Malik
Community Champion
Community Champion

@ExpiscornovusAny help here. I am really bad with expressions.

Kaif_Siddique
Solution Sage
Solution Sage

Hi @FLOWMASTER3000 ,

 

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.

Kaif_Siddique_0-1663875408453.png

 

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

Expiscornovus
Super User
Super User

Hi @FLOWMASTER3000 & @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?



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,874)