web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to process temp...
Power Automate
Unanswered

Unable to process template language expressions in trim/split action, causing Flow Failure status even if it succeeds

(0) ShareShare
ReportReport
Posted on by

Error is:

 

 

Unable to process template language expressions in action 'Initialise_SubjectTrimmed' inputs at line '0' and column '0': 'The template language expression 'trim(split(split(variables('EmailSubject'),'Issue ')[1],':')[0])' cannot be evaluated because array index '1' is outside bounds (0, 0) of array. Please see https://aka.ms/logicexpressions for usage details.'.

 

 

My code is:

 

 

trim(split(split(variables('EmailSubject'),'Issue ')[1],':')[0])

 

 

 What I'm trying to do:

The code takes the subject from an email and tries to find the text between "Issue " and ":". For example, if the email subject is "Issue 123: something is broken", the output is 123.

 

The problem:

If the Issue text exists, the script functions normally. I have configured a runafter if the above action fails (eg there was no issue text) and the entire script functions. However, this triggers the above error and the flow is considered a failure. Ultimately I don't care about the error as I'm handling it, but this problem is making it hard to debug other errors as it's giving me false positives. 

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,484 on at

    Hey @Anonymous 

     

    Can't test this currently, but try this expression for this:

     

    split(split(variables['EmailSubject'],':')[0],' ')[1]

     

    So, in the above expression, first I am splitting the string where colon is. Then taking the 0 index value.

     

    So, if we take the example 

    Issue 123: Error

    Then after first split the expression would look like this:

    [Issue 123], [Error]

    Then in the second split I am taking Issue 123 and splitting it at a space and as I want 123 I am using [1] to extract it.

     

    I hope this helps. 🙂

     

     

     

  • Community Power Platform Member Profile Picture
    on at

    Hi Sundeep,

     

    That's a cool way to do it - but if the email subject is "Re: Issue 123: error", I assume that this won't work because it'll start parsing at the first colon.

  • Verified answer
    v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Are you trying to split the string by the keyword "Issue"?
    I suggest you add a Condition action to compare whether "Issue" is included in the string before splitting.

    .
    vdezhilimsft_0-1669367107621.png

     

    vdezhilimsft_1-1669367107622.png

     

    vdezhilimsft_2-1669367107623.png

     

    vdezhilimsft_3-1669367107623.png

     

    vdezhilimsft_4-1669367107624.png

     


    Best Regards,
    Dezhi
  • Community Power Platform Member Profile Picture
    on at

    Thanks Dehzi, that's a great solution. That has solved my problem 🙂 I've re-organised my flow to fit this logic.

     

    For anyone else trying this, I also added an IsInteger check afterwards in case someone uses the word "Issue " but doesn't follow it with a number.

     

    Imrhien_0-1669583136795.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard