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

Expression invalid -- Splitting subject by Pipe delimiter

Hi all! I've referred to a number of past help requests but can't seem to find a solution to this. I'm trying to split a subject line (delimiter = "|") of an email to use each split as a separate variable later in the flow.

 

The subject lines are in this format:

Company|PrimaryKey|ForeignKey|DateStart|DateEnd

 

 

The expression I'm trying to use to parse the above subject line is this:

split(@{triggerOutputs()?['body/subject']},'|')

 

However, when I try to use this my expression is flagged as Invalid.

 

What could I be missing here, or doing wrong? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Expression invalid -- Splitting subject by Pipe delimiter

Try this in you compose action as expression

split(triggerOutputs()?['body/subject'],'|')

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: Expression invalid -- Splitting subject by Pipe delimiter

Hello,

I assume the problem is with @{triggerOutputs()?['body/subject']}

Also are you storing the result in Array variable? split will return an array result

Can you please show which variable you are getting the output from (hover your mouse over that variable to see the correct syntax)

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

Highlighted
New Member

Re: Expression invalid -- Splitting subject by Pipe delimiter


@Rahber wrote:

I assume the problem is with @{triggerOutputs()?['body/subject']}


Yes, that's the bit that's causing the error; the same expression with dummy text doesn't throw any errors.

 


@Rahber wrote:

Also are you storing the result in Array variable? split will return an array result

Can you please show which variable you are getting the output from (hover your mouse over that variable to see the correct syntax)

I was using the "Compose" action which I was under the impression created an array variable; is that incorrect? The screenshot below shows both the action & the variable.

compose.png

Highlighted
Super User
Super User

Re: Expression invalid -- Splitting subject by Pipe delimiter

Try this in you compose action as expression

split(triggerOutputs()?['body/subject'],'|')

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

View solution in original post

Highlighted
New Member

Re: Expression invalid -- Splitting subject by Pipe delimiter

This worked, thank you! Looks like I've been grabbing my variables the wrong way 😅

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Kudoed Authors
Users online (6,488)