cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Community Support
Community Support

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

Highlighted

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

4 REPLIES 4
Highlighted
Helper I
Helper I

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?

Highlighted
Community Support
Community Support

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

Highlighted

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

Highlighted

Hi Alice,

 

Looking for a solution to an issue I have, I just found this post. I would like to see if you or someone else can help me here. I am doing something similar to what Tyrone was doing but I am not only working with one output but multiples. Let me explain my self.

 

I am extracting data from an email. The email stores different sales data. For example Gross Sale, Tips, and Tax to name a few. I am using split to extract the values and is working fine but I am doing so much repetitive work and I bet there should be a way to reduce my flow. 

 

Let me explain what I am doing right now:

  1. Extract body of the email
  2. Search for key words like: Sales, Tax, Tips
  3. Split by "$" and get the last part
  4. Split by "</" and get the first part to get the value I need

Step 3 and 4 are the same regardless of the specific word I am working at the moment so I would like to know if there is a way to get the outputs when searching for all the different words but then just using one steps 3 and one step 4 to process all the words instead of repeating steps 3 and 4 for all of the words. This will be clearer once you see the following image:

 

Screen Shot 2020-09-14 at 7.53.07 PM.png

Step 2 (Unique process for every different word.)

 

Screen Shot 2020-09-14 at 7.58.23 PM.png

 

Step 3 (Used on every different word as step 4) 

 

Screen Shot 2020-09-14 at 7.59.13 PM.png

Hope this all make sense 😅

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (7,722)