cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
michaelwoodew
Level: Powered On

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

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

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

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

michaelwoodew
Level: Powered On

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

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

View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

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

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. 

 

 

Community Support Team
Community Support Team

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

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
michaelwoodew
Level: Powered On

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

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

Community Support Team
Community Support Team

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

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

michaelwoodew
Level: Powered On

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

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

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (6,541)