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 / for loop size in deskt...
Power Automate
Answered

for loop size in desktop flow is doubled up when calling it using cloud flow

(0) ShareShare
ReportReport
Posted on by 235

Hi, 

 

I'm scrapping websites to get stock price according to tickers in Excel.

 

It's all fine when doing it locally (PAD) while when calling it from the cloud flow (through machine connector), it seems it doubled up the tickers w/ "" so it kept scrapping though it with ticker = "" after the loop went through all real tickers.

 

I thought the issue happened is because when we open an excel and get first row, the getting_free_row function might have been executed before table has fully loaded in. Therefore I put a wait after launch excel. But the situation is still the same.

 

for loop size in desktop flow is doubled up.png

 

And the problem is when calling PAD through cloud flow, we can't see what happened among the process of PAD (ex. variables...). And this double-up issue wouldn't happen when calling it locally. So we will never know what exactly happened inside the process.

 

If anyone is facing the similar problem or has any insight/solution, please kindly help me addressing this tricky issue.

 

Thank you in advance,

Hsiang

I have the same question (0)
  • Verified answer
    tkuehara Profile Picture
    667 on at

    Hi @chienhsianghung 

     

    The only way I can think of that you could see what happened during you flow execution is to manually add log steps.

    Try creating a simple text file and then throughout your code (especially before/after the error/critical steps) write the variables in that text file. This approach saved me a lot of times (it's actually a good practice to do so).

    tkuehara_0-1626281087026.png

    Pro tip: if you have a complex flow with lots of subflows, I also recommend adding the function name, date and time and any other relevant identifier because log files can become extremely large so creating a well organized log file structure from start will definitely help you. You can create separate log files for each day, for example, but ofc those add up complexity to your solution.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    A problem I ran into with "Get First Free Row" was that the command actually looks at the 1st row after the human version of CTRL + End.  Therefore, anytime I am trying to pull the first row using this command, I use the following Excel Macro to clear all excess off the worksheet first:

    Sub Clear_All()
    '
    ' Clear_All Macro
    ' remove all excess rows and column so bot can count the correct number

    'define Last Column
    Range("A1").Select
    Selection.End(xlToRight).Select
    Dim LC As Integer
    LC = Selection.Column

    'clear everything after last column
    Columns(LC + 1).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.Clear

    'define last row
    Range("A1").Select
    Selection.End(xlDown).Select
    Dim LR As Integer
    LR = Selection.Row

    'clear everything after last row
    Rows(LR + 1).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Clear

    'go back to A1 and save to reset End of worksheet
    Range("A1").Select
    ActiveWorkbook.Save
    End Sub

     

    Best of luck!

  • yoko2020 Profile Picture
    495 on at

    Try use this action instead to determine first free row.

     

    2021-07-15_045407.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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard