web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Add if statement to ex...
Power Automate
Answered

Add if statement to expression

(1) ShareShare
ReportReport
Posted on by 98
Hi all,
 
I have the following expression that shortens URL links for me. Source is a Sharepoint list:
concat('<a href="', item()?['xxx'], '">xxx</a>')
 
The expression pulls the URLS from a SharePoint list, converts them into HTML and finaly send it as a report via email.
 
Unfortunately, "xxx" entries are also made where no URL has been set in the Sharepoint list.
I would like to add an if statement that, if URLs are not set, gives a note such as "please hand in later" as non url, just as non-executable text.
 
How do I best proceed?
 
Regards
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    13,431 Super User 2025 Season 2 on at
    I would do the following if I am understanding what you need correctly:
    1. Add a string variable to your flow and set the default value to "please hand in later".
    2. Add a condition to your flow to check that the URL exists, if it does, on the yes side of the condition, set the variable to your expression.
    3. Then use the variable in your e-mail.
     
  • Verified answer
    Ellis Karim Profile Picture
    11,793 Super User 2025 Season 2 on at
    Hi vipfafen,
     
    If I have understood correctly, you could try the following expression in a compose action: 
     
    if(empty(item()?['xxx']), 'please hand in later', concat('<a href="', item()?['xxx'], '">xxx</a>'))
     
    Here's a demo flow:
     
     
     
    Ellis
     
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 273 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 135 Most Valuable Professional

Last 30 days Overall leaderboard