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 / How do I add an IF con...
Power Automate
Unanswered

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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard