cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CHF
Level: Powered On

Parse compose output into another compose

Hi

 

Im trying to parse output from one compose into another compose but im not sure of the syntax or if it’s possible? 

 

My first compose is looking at an email subject and selects the last characters after a specified string of: “Job “ This works ok J.

 

The second compose doesn’t, is meant to look at the output of the first compose and give me the all the characters before the specified string of: “

 

The subject of the email looks like this:

Completed with Exceptions (Server: "BACKUP01") (Job: "ADMIN01-Monday")

 

My first compose is: 

"@last(split(triggerBody()?['Subject'],'Job:'))"

 

and my next compose which should use the output from my first compose is:

 "@first(split(@{outputs('Compose')},'"'))"

 

I’m pretty sure it’s possible but not entirely sure how to do it. Any help would be greatly appreciated. 

 

Regards

 

Tyrone

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Parse compose output into another compose

Hi @ CHF,

 

Could you please share a screenshot of the configuration of your flow?

 

Do you want to get the value of the Job inside the double quotes such as ADMIN01-Monday from the the subject of the email looks like this:

Completed with Exceptions (Server: "BACKUP01") (Job: "ADMIN01-Monday")

 

If you would like to get the value of the Job inside the double quotes you could refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose as below:

last(split(triggerBody()?['Subject'],'Job:'))
 
The output of Compose would be  "ADMIN01-Monday"), if you would like to get the ADMIN01-Monday from the output of Compose, you could use substring() to acheive your needs, you could refer to link below to learn more about the workflow definition language:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 
The expression in the Compose 2 as below:
substring(outputs('Compose'),2,sub(length(outputs('Compose')),4))

 

 

The flow would run successfully as below:

Capture.PNG

 

Regards,
Alice Zhang

View solution in original post

CHF
Level: Powered On

Re: Parse compose output into another compose

Hi

 

Thank you for your response, I have managed to get it working with your help. Although It did not work correctly first time as I think I changed my first compose slightly but I did manage to get it working by adding a few more steps.

 

 

Here is what I did to get it working:

 

My subject of the email is:

Completed with Exceptions (Server: "BACKUP01") (Job: "ADMIN01-Monday")

 

Compose:

last(split(triggerBody()?['Subject'],'Job: "'))

 

Compose2(data1):

substring(outputs('Compose'),0,sub(length(outputs('Compose')),3))

 

Compose3(day1):

last(split(outputs('data1'),'-'))

 

Compose4(server):

first(split(outputs('data1'),'-'))

 

 

 

The results:

 

Compose:

ADMIN01-Monday")

 

Compose2(data1):

ADMIN01-Monday

 

Compose3(day1):

Monday

 

Compose4(server):

ADMIN01

 

 

What it looks like: 

Capture.PNG

 

 

Thank you so much for your help. I hope this helps other people out.

 

Regards

 

Tyrone

View solution in original post

3 REPLIES 3
CHF
Level: Powered On

Re: Parse compose output into another compose

To add to this what i get from the second compose is: 

 

"@first(split( "DATABASE02-Monday") ,'"'))"

 

So its is using the output of the first Compose but it liiks like its not actually doing the "First" split?

Community Support Team
Community Support Team

Re: Parse compose output into another compose

Hi @ CHF,

 

Could you please share a screenshot of the configuration of your flow?

 

Do you want to get the value of the Job inside the double quotes such as ADMIN01-Monday from the the subject of the email looks like this:

Completed with Exceptions (Server: "BACKUP01") (Job: "ADMIN01-Monday")

 

If you would like to get the value of the Job inside the double quotes you could refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose as below:

last(split(triggerBody()?['Subject'],'Job:'))
 
The output of Compose would be  "ADMIN01-Monday"), if you would like to get the ADMIN01-Monday from the output of Compose, you could use substring() to acheive your needs, you could refer to link below to learn more about the workflow definition language:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 
The expression in the Compose 2 as below:
substring(outputs('Compose'),2,sub(length(outputs('Compose')),4))

 

 

The flow would run successfully as below:

Capture.PNG

 

Regards,
Alice Zhang

View solution in original post

CHF
Level: Powered On

Re: Parse compose output into another compose

Hi

 

Thank you for your response, I have managed to get it working with your help. Although It did not work correctly first time as I think I changed my first compose slightly but I did manage to get it working by adding a few more steps.

 

 

Here is what I did to get it working:

 

My subject of the email is:

Completed with Exceptions (Server: "BACKUP01") (Job: "ADMIN01-Monday")

 

Compose:

last(split(triggerBody()?['Subject'],'Job: "'))

 

Compose2(data1):

substring(outputs('Compose'),0,sub(length(outputs('Compose')),3))

 

Compose3(day1):

last(split(outputs('data1'),'-'))

 

Compose4(server):

first(split(outputs('data1'),'-'))

 

 

 

The results:

 

Compose:

ADMIN01-Monday")

 

Compose2(data1):

ADMIN01-Monday

 

Compose3(day1):

Monday

 

Compose4(server):

ADMIN01

 

 

What it looks like: 

Capture.PNG

 

 

Thank you so much for your help. I hope this helps other people out.

 

Regards

 

Tyrone

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 197 members 4,871 guests
Please welcome our newest community members: