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 / 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,335 Super User 2025 Season 2 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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard