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 / IF Else Condition Not ...
Power Automate
Unanswered

IF Else Condition Not Working in Power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 12

Hi Community,

 

I am facing an issue with an If Else condition in my Power Automate Desktop flow. Despite setting up the condition correctly, it doesn't seem to work as expected.

Context: I am working on a flow to read contract IDs from an Excel file, search for each contract from test environment and download associated documents. If documents are found, the status should be marked as "Success"; otherwise, it should be "No Document Found".

 Here are the main steps in my flow:
Launch Excel and read contract IDs.
Loop through each contract ID.
Launch Chrome and navigate to specific webpage
Log in and search for the contract ID.
Check if a document download link is present using an If Else condition.
Update the Excel file with the status and timestamp.
Specific Issue: The If Else condition is supposed to check if a document download link exists. However,it doesn't seem to work as expected.
Here is the relevant part of my flow:// Extract Contract ID from CurrentRow
Set Variable
- Name: %CurrentContractID%
- Value: %CurrentRow["ContractID"]%

Launch new Chrome
- URL: [Webpage URL]
- Instance Variable: %BrowserInstance%

// Find the Document Link
Find Element on Web Page
- Instance: %BrowserInstance%
- Selector: [Selector for the document download link]
- Result Variable: %DocumentLink%

// Check if documents are available
If
- Condition: %DocumentLink% is not empty
- Then
Set Variable
- Name: %Status%
- Value: "Success"
// Perform the document download...
- Else
Set Variable
- Name: %Status%
- Value: "No Document Found"
End If

What I’ve Tried:
Ensured the selector for the document download link is correct by using the browser's inspect tool.
Verified the %DocumentLink% variable is being set properly.
Tried adding logging to see the values of variables at different stages

Error or Unexpected Behavior: Despite these checks, the If Else condition doesn't behave as expected. It either always goes to the "Else" part or doesn't evaluate the condition correctly.

Could someone please help me understand what might be going wrong with my If Else condition? Any insights or suggestions would be greatly appreciated.

 

Thanks in Advance
Usha

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @usha3925 

     

    If it goes to else condition then capture the "%DocumentLink%" variable in some log file and see what value it holds?

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

     

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @usha3925 ,

     

    Please use a display message and share the screenshot of what it holds in DocumentLink.

     

    Regards,

    Vishnu Reddy

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 419

#2
Vish WR Profile Picture

Vish WR 314

#3
David_MA Profile Picture

David_MA 260 Super User 2026 Season 1

Last 30 days Overall leaderboard