Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Power automate flow condition

Posted on by 559

Hi All,

I am trying a flow which send email to the respective Managers when flow is triggered from button  click in PowerApps. I am passing the managers names in a array and collecting the managers project details from SharePoint with variables. When appending the value with HTML table I have condition to satisfy only then the mail will be sent to the respective manager with their details. My code is

<tr>
<td >@{items('Apply_to_each_4')['ProjectName']}</td>
<td >@{items('Apply_to_each_4')['AccountName']}</td>
<td >@{items('Apply_to_each_4')['DM Name']}</td>
<?php @{if(equals(items('Apply_to_each_4')?['ProjectType'],'Dev-Enh_Upgr-Impl'),equals(items('Apply_to_each_4')?['ProjectMethod'],'Traditional Development'),
equals(items('Apply_to_each_4')?['Projectcontract'],'T & M'))}{?>
<?php elseif @{if(equals(items('Apply_to_each_4')?['Projectcontract'],'FP'),equals(items('Apply_to_each_4')?['ProjectMethod'],'Traditional Development'),
equals(items('Apply_to_each_4')?['Projectcontract'],'FP'))}{?>
<?php elseif @{if(equals(items('Apply_to_each_4')?['ProjectType'],'Dev-Enh_Upgr-Impl'),startsWith(items('Apply_to_each_4')?['ProjectMethod'],'Agile'),
startsWith(items('Apply_to_each_4')?['Projectcontract'],'T & M'))}{?>
<?php else @{if(equals(items('Apply_to_each_4')?['ProjectType'],'Maint-Supp-IMS'),equals(items('Apply_to_each_4')?['ProjectMethod'],'Agile Maintenance'),
equals(items('Apply_to_each_4')?['Projectcontract'],'FP'))}{?>
<td style="background-color:@{if(equals(items('Apply_to_each_4')?['Schedule'],'Red'),'Red',
if(equals(items('Apply_to_each_4')?['Schedule'],'Amber'),'Orange',
if(equals(items('Apply_to_each_4')?['Schedule'],'Green'),'Green','')))};" style="background-color:@{if(equals(items('Apply_to_each_4')?['Schedule'],'Red'),'Red',
if(equals(items('Apply_to_each_4')?['Schedule'],'Amber'),'Orange',
if(equals(items('Apply_to_each_4')?['Schedule'],'Green'),'Green','')))};" style="background-color:@{if(equals(items('Apply_to_each_4')?['Commitment'],'Red'),'Red',
if(equals(items('Apply_to_each_4')?['Commitment'],'Amber'),'Orange',
if(equals(items('Apply_to_each_4')?['Commitment'],'Green'),'Green','')))};" style="background-color:@{if(equals(items('Apply_to_each_4')?['On time'],'Red'),'Red',
if(equals(items('Apply_to_each_4')?['On time'],'Amber'),'Orange',
if(equals(items('Apply_to_each_4')?['On time'],'Green'),'Green','')))};" >@{items('Apply_to_each_4')['Schedule']}@{items('Apply_to_each_4')['Schedule']}@{items('Apply_to_each_4')['Commitment']}@{items('Apply_to_each_4')['On time']}</td>
<?php}?>
<?php}?>
<?php} ?>
<?php} ?>

</tr>

Here I have combined with Php to check the condition. Based on Project method and contract type the condition satisfices:

For each project only one condition will will be true. When Project Methodology is Traditional and contract type is (T&M or FP) then it must take onbly schedule column value. But in my case since I have used only one td for all values even though the condition is false also two values get displayed in mail. I have attached screenshot for the same.

Any help or suggestions on this..

Categories:

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

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,733

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,750

Leaderboard