Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Error on Compose steps - "Unable to process template language expressions"

I have a flow that is pulling content from an automated email body (employees raise defect reports via an online form, automated email is issued in a standard format after each report) in order to populate a SharePoint list.


I have various Compose steps to pull each relevant SP list item data point out but, every so often, I get the following error message;

Unable to process template language expressions in action 'DateReported' inputs at line '1' and column '27858': 'The template language expression 'trim(split(split(body('Html_to_text'), 'Reporting Date')[1], 'Submitted')[0])' cannot be evaluated because array index '1' is outside bounds (0, 0) of array. Please see for usage details.'.


This happens on different Compose steps (i.e. it's not the same step causing the errors each time) and the error happens randomly - over this weekend, the Flow ran 8 times, then 1 error, 1 run, 1 error, 1 run, 2 errors, 2 runs; there's no discernible pattern to help me identify what's causing it and, as I say, error's are occurring on Compose steps that worked perfectly fine on the previous run!?!


I'm fairly new to Flow, so if anyone could give me some pointers please?

Super User II
Super User II

HI @TD-19976 


The error is indicating that the array may be empty or only with 1 item, since you're accessing the second item ([1]) in the array.


To debug this I would click the runs that failed and try to find what's inside the "body('HTML_to_test')" and see if the "Reporting Date" shows up. If it doesn't then your split will only return one element (the full string) and your split will fail.



If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks @manuelstgomes - I've looked through each fail with following findings;

  • Reporting Date - this is automatically generated by the system based on when the report is submitted and auto-filled on every email sent, so this is never blank & hence can't understand why this fails
  • Location - users can leave this blank, and this seems to be cause of those fails


Is there any way to overcome this, so the Flow writes whatever data is captured, and skips anything that 'fails'?  As it stands, I'm missing 8-9 other data points that are fine simply due to 1 that fails....

Helpful resources

Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (25,652)