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
Solution Sage
Solution Sage

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

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

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,990)