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 Template working ...
Power Automate
Unanswered

Flow Template working for one SQL view but not another

(0) ShareShare
ReportReport
Posted on by

Hi, hoping someone can let me know if I'm doing something wrong or if my flow is just cursed. 

 

I am using the 'Refresh SharePoint list items from SQL Server on a recurring basis' flow template. 

 

I have built two Sharepoint Lists in the same site with identical column headers (all data types as single line of text). 

 

I have two SQL views which are also identical in terms of column headers and data types and sources. The only difference is one is filtering on "Where [PartNumber] = '1'" and one is "Where [PartNumber] is NULL"

 

[PartNumber] is a column in both the SQL views and the 2 SharePoint Lists. 

 

I followed the template for the SQL with the [PartNumber] is NULL view, no issues, loaded in over 1000s rows. Great stuff. 

 

Duplicated the flow, switched the target list to the other one in the site, flipped the SQL query to the [PartNumber] = '1' view, and I got the following error as soon as I got to the final 'Apply to each' step: 

 

"The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Get_rows_(V2)')?['body/value']' is of type 'Null'. The result must be a valid array. "

Weird. Strange. Can't understand why, so I flipped the the SQL view back to the "[PartNumber] is NULL"  source and it worked fine.

 

I have tried rebuilding the flow from scratch and it gets the error. 

 

I have no NULL values in my dataset. 

 

If anyone can suggest any solutions I'll be really grateful. 

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,960 Moderator on at

    @gbullivant 

     

    Since I cannot see the views, nor the data, nor much else I am going to make an educated statement

     

    The error is easy, you are not getting any rows back so you are trying to do an Apply to each on a blank dataset.

     

    So now you need to work on the SQL side, not the PA side. run the query just like that on the correct view and see if you get any data back. Because thats the issue.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard