web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel Script says run ...
Power Automate
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

 

 

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    on at

    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

     

  • Community Power Platform Member Profile Picture
    on at

    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
  • Verified answer
    v-siky-msft Profile Picture
    on at

    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

    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

  • Community Power Platform Member Profile Picture
    on at

    For other ppl's reference:

     

    1) delete and recreate the flow.

    2) left excel unopened and the flow ran properly. 

     

  • ClintRB Profile Picture
    91 on at

    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard