cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bf1980
Frequent Visitor

trying to update an excel spreadsheet based on cell contents

Hello,

I am trying to update a speadsheet in the following ways:

if a cell is empty,  delete the row

 

if that same cell contains certain words,  delete the row.  Below is what i have(I left off the Empty option, as I gave up on it a while ago,  but if you have suggestions, I would love to try it)

 

flow1.JPGFLow2.JPG

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: trying to update an excel spreadsheet based on cell contents

Hi @Bf1980,

 

Since you are judging the same Column, you could directly merge these Conditions into one condition.

It can also be judged whether this field is empty or not.

I speculate that these three conditions need to delete the corresponding row as long as they satisfy one, so you need to use the or() function.

You could consider replacing Delete a row action with Delete row action.

In addition, if you can, it is recommended to set Button or Recurrence as the trigger, because deleting the row operation is also changing the file, which will make Flow into a loop.

Expression reference:

@or(contains(items('Apply_to_each')?['PM_x0020_Description'], '"Emergency"'),contains(items('Apply_to_each')?['PM_x0020_Description'], 'Evaluation'),empty(items('Apply_to_each')?['PM_x0020_Description']))

Image reference:

13.PNG12.PNG

Please take a try.

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Bf1980
Frequent Visitor

Re: trying to update an excel spreadsheet based on cell contents

Thank you!  I have tried your solution, it seems to want to work, but I get a 423 error everytime I run it.  I tried to do a save as and created a new file, just to see if that would work,  it did not!  do you have any ideas?

Bf1980
Frequent Visitor

Re: trying to update an excel spreadsheet based on cell contents

So, I was able to get the flow to run,  But it is not deleting any of the rows.

 

I modified your code slightly:

@or(contains(items('Apply_to_each')?['PM_x0020_Description'], '"Emergency"'),contains(items('Apply_to_each')?['PM_x0020_Description'], '"Evaluation"'),empty(items('Apply_to_each')?['PM_x0020_Description']),contains(items('Apply_to_each')?['PM_x0020_Description'], '"Engineering"'),contains(items('Apply_to_each')?['PM_x0020_Description'], '"Inspection"'))

 

 

Capture.PNG

Bf1980
Frequent Visitor

Re: trying to update an excel spreadsheet based on cell contents

attached you will see that the flow completes successfullyCapture.PNG

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,188)