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
    12,982 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,683 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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard