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 / Extract part of values...
Power Automate
Unanswered

Extract part of values from an Outlook subject to a Sharepoint List

(1) ShareShare
ReportReport
Posted on by 13

Dear community, 

This is what I am trying to achieve. 

I have a Sharepoint List with items with these headers: 

 

The subject format is something like this: 

Lorem Ipsum | Lorem Ipsum Dolor  | ID 37493874 | Email

My list below is a Sharepoint list. 

The subject line's string length is unfortunately not always the same nor is the numeric value as well

What I would like to achieve is each extracted part of the subject line should map to a corresponding cell in the Sharepoint List. Something like:

 

TitlePartnerIDE-mail
Lorem IpsumLorem Ipsum Dolorinteger or strfirstname.lastname@microsoft.com
Lorem Ipsum DolorLorem Ipsum Dolorinteger or str

firstname.lastname@microsoft.com

 

I have tried playing with Compose inputs to no avail. Some guidance would be appreciated 🙂 Thank you!

Categories:
I have the same question (0)
  • trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    Hi @locallyhostedbo ,

     

    Here's a compose expression to implement.  If this was helpful, please mark as a solution to help others find it quickly too!

     

    trice602_0-1693235115723.png

     

    trice602_1-1693235148250.png

     

    Please use [0], [1], [2] respectively for each part of the compose expression.

     

    trice602_2-1693235194959.png

     

    split(variables('Subject'), '|')[0]
     
     
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @locallyhostedbo 

    Split Subject Line

    First, you need to split the subject line by the pipe. Use an expression. For my example, I'm using a Compose action to hold your sample subject line. 

     

    Add a Compose action and use the split() function. The split() function takes two parameters. The string and the separator:

    split([string],[separator])

    For my expression I've inserted the outputs from the Compose action above (you can insert the subject line from your email). Then, insert the pipe character between single quotes.

    split(outputs('Compose_-_Subject_Line'),'|')

     

    creativeopinion_0-1693235067312.png

     

    Give it a test. The split() function will split your subject line at the |. 

    creativeopinion_1-1693235260248.png

     

    Access Array Items

    Your subject line is now an Array. To access each part of the array, you need an expression. Arrays start at [0], [1], [2].. etc.

     

    To get the first item of the array you need to start with:

     ?[0]

    creativeopinion_2-1693235341156.png

    Place your cursor at the start of your expression and click on the Dynamic content tab. Insert the outputs from the Compose action that is storing the subject line array. 

    creativeopinion_3-1693235396116.png

    Switch back to the Expression tab and wrap the entire expression in a trim() function. This will remove any spaces before/after your string of text.

    creativeopinion_4-1693235488107.png

     

    trim([insert the Compose action with the split() function here]?[0])

    Repeat for each part of your Subject line.

    creativeopinion_5-1693235557819.png

     

    Run a test to confirm the outputs of the Compose action.

     

    You can then use the outputs of those compose actions in your Update/Create Item action.

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

     

     

  • locallyhostedbo Profile Picture
    13 on at

    I am sorry, but none of the solutions work unfortunately. 

    This is what I receive as error: 

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


    At creation, I am unable to see the input / output data @trice602 and @creativeopinion your regex are "Invalid Expressions" according to automate flow. 

    If I may rephrase: 

    These subjects are always random. I don't always receive the same subject obviously, but the same pattern with the | separator. 


    Those | are a mark for a "header" in a Sharepoint List. This involves also the creation of a new step in the flow, which is "Create item" in sharepoint. 

    Is it possible for you guys to be a little more specific, pls? I am a bit new to this and more explanation would be really really awesome.

  • Verified answer
    trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    Hi @locallyhostedbo ,

     

    Yes, glad to help.  Please start by sharing your current flow, and a the email with the subject that creates the error.  Please expand your actions so the content of each action is visible; otherwise we are kinda guessing what the root cause is.

     

    That said, the expression provided is dynamic and will handle any length in each part of the subject; the issue is there must be three parts in the subject otherwise it will not find the part to split/extract.  So, in your error message there wasn't a aaaa | bbbbb | ccccc  "bbbbb" part because it said it didn't exist.

     

     

  • locallyhostedbo Profile Picture
    13 on at

    @trice602 you are amazing! It worked!

  • trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    Let's have a great Monday! 

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard