cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Akshay_R_cowrks
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

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
Rahber
Super User
Super User

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


@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

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

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,827)