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.
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
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional