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 / Stored Procedure - ['T...
Power Automate
Unanswered

Stored Procedure - ['Table1'] is of type 'Null'

(1) ShareShare
ReportReport
Posted on by 14

Hi

 

I am successfully executing a stored proceedure via teh data gateway within a flow. it is returning a row of data which I am also successfully parsing from JSON to an object using the "Parse JSON" action.

 

The "Table1" field is showing as an array of objects 

{
 "Table1": [
 {
 "key1": 123,
 "key2": 456
 }
 ]
}

 

 

However when I try to iterate this array with an "Apply to each" action, the flow errors with:

"The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON')?['ResultSets']?['Table1']' is of type 'Null'. The result must be a valid array."

 

I have tried array(body('Parse_JSON')?['ResultSets']?['Table1'])

 

I can see the data, how can I process it if flow believes "Table1" is null?sproc.png

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @michaelwoodew 

     

    Can you please share the following details:

    1. Schema that you are using the parse json action

    2. A screenshot of what you are getting in the run history of teh Parse JSON action. 

     

     

  • v-bacao-msft Profile Picture
    on at

    Hi @michaelwoodew ,

     

    Please check whether Body of Execute stored procedure action contains property-Table1.

    Or check if Body of Parse JSON contains Table1 property.

     

    Parse JSON is suitable for parsing JSON data with fixed properties. The properties name is not dynamically changed.

     

    For example, the following data is used to generate Schema, but the parsed content does not contain Table1 at the end, so there will be problems when referring.

    {
     "Table1": [
     {
     "key1": 123,
     "key2": 456
     }
     ]
    }

    Image reference:

    13.PNG14.PNG

     

    Best Regards,

  • michaelwoodew Profile Picture
    14 on at

    Hi @v-bacao-msft,

     

    Thanks for your guide, 

    I can confirm that the JSON Schema is set Expecting the exact Table1 structure that the procedure returns and shows a successful output. 

     

    ParseJson.jpgParseJson2.jpg

  • Verified answer
    v-bacao-msft Profile Picture
    on at

    Hi @michaelwoodew ,

     

    You can try to store the content that needs to be configured in Content field in an Object variable, and then populate the variable in Content field.

     

    Best Regards,

  • Verified answer
    michaelwoodew Profile Picture
    14 on at

    Thanks @v-bacao-msft 

    Your suggestion pointed me to a working work-around. 

     

    I'm passing ResultSet from the stored proceedure into an object var, then JSON Parsing that (aleady) object. The JSON Parse is so that I can provide it with a schema so that I can easily select the values in the foreach in later steps.

    ParseJson.jpg

     

    Thanks

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