How to create a Variable with a URL for Logic App?

JK 1 Reputation point
2022-05-05T08:43:31.91+00:00

I created a workflow in logic app consumption plan wherein the logic app will send emails to recipients that are in a table. Inside the mail body, I want to insert a URL wherein part of the URL is a variable coming from the table.

ex.
Table Data
FIrstName LastName ID
John Smith 1234

in the email body:
Link=www.abc.com/@ID (result will be www.abc.com/1234)

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
{count} votes

1 answer

Sort by: Most helpful
  1. Bruno Lucas 4,436 Reputation points MVP
    2022-05-05T12:19:34.53+00:00

    Hi @JK

    There are a few different ways to accomplish that.
    For email sending tasks (outlook or gmail) you can preferably use a string variable or the composer task.

    With the composer you can actually generate the who mail message dynamically:

    199169-image.png

    Than drag it into the email body:

    199271-image.png

    The gmail task will take it even direct:

    199233-image.png

    if you prefer variables, initialize one in the top of the flow:
    199272-image.png

    set the value inside the loop:

    199264-image.png

    and apply on the email body

    199265-image.png

    Outlook also worked just fine:

    199245-image.png

    Testing the email, the link is fully functioning:

    199256-image.png

    Please don't forget to click on "Accept Answer" or upvote button whenever the information provided helps you.

    0 comments No comments

Your answer

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