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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How do I add an IF con...
Power Automate
Answered

How do I add an IF condition and replace expression at the same time?

(0) ShareShare
ReportReport
Posted on by 18

Hi all,

 

I have created a flow that converts an HTML layout to a PDF file and sends that output for approval. The issue is that one of the HTML tags requires an answer based on a condition.

ex. If X = 1, replace A with B, else replace A with C

 

The sample expression I composed goes like this:

replace(outputs(‘Client_Name’), ‘{Type of Relationship}’, outputs(‘Get_response_details’)?[‘body/abcdef1234567’])

 

A077BA4E-6117-4885-BC79-851E906A743F.png

BFF58C64-D4CF-41E9-858A-F095279C22DD.png


Below is the part where I need the conditional expression but I’m stuck with an ugly branch of actions. Is there a way to compose the condition and replace function in one string? I don't want to continue adding more actions to this branch because my Power Automate keeps lagging. 

0A4B34AF-5C71-4330-98EA-45430DCD71DB.png

 

Can anyone help me please? Thanks!

 

Categories:
I have the same question (0)
  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @Friedmochii_92  

    Expression you need to build in this way-

    if(equals(x,1),replace(),replace())

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • Friedmochii_92 Profile Picture
    18 on at

    Thank you so much 🙂 it worked like a charm

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard