Extract URL link behind email body using Azure Logic Apps

King Java 565 Reputation points
2024-05-21T20:08:45.01+00:00

I am trying to extract csv file from URL that is indicated on the email.

I have followed the step from this thread.

This is current process in Azure Logic App:

User's image

This is close-up of the Regex:

User's image

This is output from the second step (Get emails (V3)) - edited little bit for confidentiality.

User's image

I am not sure whether I am putting the Regex correctly.

If I pass this (3rd step), I might have more question on the 4th step (where it puts the data output into Azure Blob storage.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,222 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 16,286 Reputation points
    2024-05-21T22:53:01.3133333+00:00

    Hi @King Java Thank you for posting the question here.

    The error message indicates that the JavaScript could not extract body from workflowContext.trigger.outputs.body as it is undefined. The trigger in your work flow is a Timer trigger and it would not have a body property you are trying to parse. You can use Dynamic content to get the Body of your email from action Get emails (V3). Please refer the below image for reference

    User's image

    User's image

    I would also recommend using a When a new email arrives (V3) trigger as it might be an ideal option. Using it would avoid the overhead of looping through the emails and you can access the body of each email from this trigger in your JavaScript using var text = workflowContext.trigger.outputs.body

    Hope this answers your question. Please let us know if you need any additional assistance in the comments below.


    If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.