Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Excel Script says run successful but didn't - reset filter

(0) ShareShare
ReportReport
Posted on by

Hi there,

 

I've been using a flow that parse emails then insert a new row into an online Excel table. And l learnt recently that if the user left filters applied on the table the insert action will fail.

 

Therefore I came up an idea that to build another flow  that runs on every Sunday to reset the filter, to prepare for the Monday's inserting flow runs. I've used the excel script feature to archive this. However even the run history says run successfully but the table is left untouched. I can manually trigger that script and it works just as expected. 

 

Don't know which step is wrong here as it is definitely not a hard one to build.

 

Is this a good workaround anyway? I'm open for any ideas here.

 

ResetFilterFlow.JPG

 

 

  • ClintRB Profile Picture
    91 on at
    Re: Excel Script says run successful but didn't - reset filter

    Hi All,

     

    I to had this issue and when I set up a separate test file it work normally and as I expected.  Different type of function but same non operation.

    What I ended up discovering what the I had two separate table with a table on each.  The script running on the second tab and table 2 was affecting the the first tab and table 1.

    So I just moved table 2 onto the first tab and then it worked.

     

    Cheers

     

    Clint

  • Community Power Platform Member Profile Picture
    on at
    Re: Excel Script says run successful but didn't - reset filter

    For other ppl's reference:

     

    1) delete and recreate the flow.

    2) left excel unopened and the flow ran properly. 

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Excel Script says run successful but didn't - reset filter

    Hi Sik,

     

    I did try to close the excel then run the flow again it still didn't work.  Any further ideas?

     

    Regards,

    Lia

     

     

     

    Regards,

    Lia

  • Verified answer
    v-siky-msft Profile Picture
    on at
    Re: Excel Script says run successful but didn't - reset filter

    Hi @Anonymous ,

     

    Your script is great and works properly on my side. 

    All I can suggest is that you need to turn off Excel, and when running Flow, and notice the limits for Office script.

     

    Sik

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Excel Script says run successful but didn't - reset filter

    Hi Sik,

     

    thanks for replying on this post. 

     

    I used the recorder in Excel to make this script. The script details are the following:

    function main(workbook: ExcelScript.Workbook) {
      let tbrecords = workbook.getTable("tbrecords");
      // Clear auto filter on table: 'tbrecords'
      tbrecords.getAutoFilter()
        .clearCriteria();
    }
     
    It's no exactly the same as yours as I can see.
     
    Lia
  • v-siky-msft Profile Picture
    on at
    Excel Script says run successful but didn't - reset filter

    Hi @Anonymous ,

     

    Could you please share the action steps and code for ClearFilter script?

    I just made a test on my side to clear filter by office script, but it works well. Here is my script for your reference:

    Snipaste_2020-11-18_11-53-13.pngSnipaste_2020-11-18_11-54-36.png

     

    If your script is great, the issue could be due to the Excel connection, please try to re-create a new script in new worksheet and re-create the Excel Business connection to try again.

    Hope this helps.

    Sik

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow