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 / Flow taking over 13 ho...
Power Automate
Unanswered

Flow taking over 13 hours to run. Multiple Composes and create item in list

(0) ShareShare
ReportReport
Posted on by 920 Super User 2024 Season 1

Hi,

 

How can I better optimize my flow?13 hours is way to long...

 

First part - 

1. Reoccurrence.

2. Initialize variable of location of an excel on my onedrive

3. Get table from this excel.

wonka1234_0-1695734445360.png

4. Compose columns from this table in my excel file.

 

wonka1234_1-1695734498564.png

 

Compose Statement - 

items('Apply_to_each')?[concat('Start of Period ''/'' Date')]
 
2nd compose -
if(
    empty(outputs('Compose')), 
    null, 
    addDays('1899-12-30', int(outputs('Compose')), 'yyyy-MM-dd')
)

 

This is repeated several times for 6 or 7 date columns. Ie compose 3 and 4 will be for another date column, and so on.

 

5. Create items in list -

 

wonka1234_2-1695734608265.png

 

my excel table has about 50 columns and 2000 rows.

 

any help on making this faster would be appreciated.

 

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,508 Moderator on at

    @wonka1234 If you are returning a single table, you do not need the first Apply to Each action. Refer to this section of a YT tutorial on how you can avoid the first apply to each action.

     

    I also you can streamline your flow by using a Filter Array action. To learn more about how to use the Filter Array action, please refer to this recent YT Tutorial I uploaded. Use the Filter Array action to filter out the rows that do not have a Start of Period date so you can compose a date dynamically for those items. 

    Can you provide a bit more insight on the multiple date columns?

     

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @creativeopinion  still took over 22 hours to complete. I only have the one apply to each now though. any other ideas as to why?

  • creativeopinion Profile Picture
    10,508 Moderator on at

    @wonka1234 Can you upload a screenshot of what your flow looks like? Did you add a Filter Array action to your flow?

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    I cannot filter array as the column headers do  not show up. I tried filtering array like this blog post -  https://flowaltdelete.ca/2020/04/12/excel-filtering-columns-with-space/

     

    my full workflow is same as above - however i did make a change based your tutorial to get rid of the first apply to items .

  • creativeopinion Profile Picture
    10,508 Moderator on at

    @wonka1234 What do you mean the column headers do no show up? Are you referring to them not displaying as dynamic content? That's odd, because I have spaces in some of my column headers and they show up. 

     

    Also, if you are trying to use an expression with your dynamic content—the dynamic content will not appear (see below on how you can use an expression to access the dynamic content).

    creativeopinion_2-1695841191416.png

     

    Get Dynamic Content with an Expression

    You can use an expression to access the values without dynamic content. In your List Rows present in a table action, limit the Top Count to 1 (so it only returns a single row of data).

     

    Add a Compose action to store the value dynamic content.

    creativeopinion_0-1695841073931.png

     

    Run a test. Take a look at the outputs. All dynamic content can be returned with an expression. You will need to know key for the content. The key is the text in red between the double quotes.

     

    creativeopinion_1-1695841146222.png

     

    Use the item() function. Any time you need to access dynamic content, start your expression like this:

    item()?['']

    In between the single quotes, enter the key for the content you'd like to return. 

     

    creativeopinion_3-1695841220977.png

     

    For example, to return the Task Description, the expression would look like this:

    item()?['Task Description']

     

    creativeopinion_4-1695841471431.png

     

     

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @creativeopinion  here is my full flow -  there must be a way to optimize this. +13 is way to long.

    wonka1234_5-1696440592919.png

     

    I have this filter array but it literally filters out 1 record lol

    wonka1234_1-1696437894242.png

    then we have the composes... and create item

     

    wonka1234_2-1696437945752.pngwonka1234_3-1696437979645.pngwonka1234_4-1696438008847.png

     

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
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard