Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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. 

  • Michael E. Gernaey Profile Picture
    40,782 Super User 2025 Season 1 on at
    Re: Flow Template working for one SQL view but not another

    @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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow