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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard