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 statement for not e...
Power Automate
Unanswered

If statement for not empty cell Excel

(0) ShareShare
ReportReport
Posted on by 22

Hi Community, 

 

Probably this problem is easy, but I can't figure out how to resolve it. Can you help me?

 

I have would like to optimize my flow as follows: 

  • if a specific cell (excel) is not empty, apply some actions;
  • otherwise, continue flow

Thank you in advance!

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

    @yellow43 
    Please follow the below proposed solution for the same. In the if condition I've mentioned the specific cell to validate.

    Deenuji_0-1709307381641.png

    Code:
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\Documents\\Holidays.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
    IF IsEmpty(ExcelData[5][0]) THEN
    Display.ShowMessageDialog.ShowMessage Title: $'''tet''' Message: $'''Apply some action''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
    ELSE
    Display.ShowMessageDialog.ShowMessage Title: $'''tet''' Message: $'''Continue other actions''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
    END

     

    -----------------------------------------------------------------------------------------------------------------------------

    If I've resolved your query, please consider accepting it as the solution and giving it a thumbs up to help others find answers faster.


  • yellow43 Profile Picture
    22 on at

    Thank You!

    But if you want to iteract every row in a specific column?

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @yellow43 

    Included for each to iterate all the rows:

    Deenuji_0-1709314700767.png

     

     

    Code:

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\Documents\\Holidays.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
    LOOP FOREACH CurrentItem IN ExcelData
    IF IsEmpty(CurrentItem[0]) THEN
    Display.ShowMessageDialog.ShowMessage Title: $'''tet''' Message: $'''Apply some action''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
    ELSE
    Display.ShowMessageDialog.ShowMessage Title: $'''tet''' Message: $'''Continue other actions''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
    END
    END

    --------------------------------------------------------------------------------------------------------------

    If I've resolved your query, please consider accepting it as the solution and giving it a thumbs up to help others find answers faster.

     

     

     

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,005

#2
Valantis Profile Picture

Valantis 825

#3
Haque Profile Picture

Haque 619

Last 30 days Overall leaderboard