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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Power automate split string

(0) ShareShare
ReportReport
Posted on by 11

I am trying to build a Flow to update a SharePoint List when recieving automated emails with a subject line such as the below, where the AEL code is different each time:

 

Subject "Sky Italia VoD Delivery Notification - AEL0111078 - "

The Sharepoint list contains a list of deliveries that I want to mark as delivered upon receipt of an email. 

I understand that I need to have an Initialize vairable split function, but cannot workout what the next Compose functions needs to contain in order to split the subject line correctly?

I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Power automate split string

    Hi @Sean_Perry 

     

    If you are looking for AEL0111078, you can use the following expression (replacing outputs('Compose') with the expression for the subject line):

     

    trim(split(outputs('Compose'),'-')?[1])

     

    I split the string on -, creating an array of 3 objects and return the 2nd (objects start from 0, so 2nd is 1) and then trim the spaces at start/end.

     

    Please consider accepting my answer as a solution if it helps to solve your problem.

    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

    trim(split(outputs('Compose'),'-')?[1])
  • Sean_Perry Profile Picture
    11 on at
    Re: Power automate split string

    This worked, but I'm obviously making a mistake, as the Get Items in SharePOint is failing:

    Sean_Perry_0-1647008754568.png

     

    with the error:
    {"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"field_41 eq 'trim(split(outputs('Subject'),'-')?[1])trim(split(outputs('Subject'),'-')?[1])'\" is not valid."}}}

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Power automate split string

    HI @Sean_Perry,

     

    You've doubled up the expression?

     

    Damien

  • Sean_Perry Profile Picture
    11 on at
    Re: Power automate split string

    This is the first time I've ever used the Compose function. I have Flow as below. What I thought I was supposed to do was identify what I wanted to split - the Subject line, run the Compose function, then search in SharePoint for the outcome of that split. As you correctly point out the error message seems to show that the expression is doubled up, but if I remove the filter on the Get Items in SharePoint it finds all the ietms in my List, not just that referenced in the inconing email Subject line? 

    Sean_Perry_0-1647012135955.png

     

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Power automate split string

    Hi @Sean_Perry 

     

    Your expression in the compose has been inserted as a string. Make sure you are on the expression tab when you type this in.

    Damien

  • Sean_Perry Profile Picture
    11 on at
    Re: Power automate split string

    I have now followed your very helful advice, built my flow, but despite running tests no action is taking place? The Flow doesn't have any errors, but the field I was hoping to update to Yes remains blank:

    Sean_Perry_1-1649350421286.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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard