web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom Connector unabl...
Power Automate
Unanswered

Custom Connector unable to process json correctly that contains array of objects of array of objects

(0) ShareShare
ReportReport
Posted on by 8

Hello,

 

I'm trying to create an action for an api for my custom connector and when I import from sample for the request or response, it was unable to process all the properties as some was missing.

 

The ones that are missing have a structure of 'array of objects of array of objects'

 

I have pasted the problematic json below

 

 "ConsentFields": [
 {
 "Fields": [
 {
 "Key": "TEXT",
 "Value": "Your consent text goes here."
 },
 {
 "Key": "DATETIMECONSENTED",
 "Value": "2020-01-01T09:40:18.527Z"
 },
 {
 "Key": "URL",
 "Value": "http://www.example.com/signup"
 },
 {
 "Key": "IPADDRESS",
 "Value": "127.0.0.1"
 },
 {
 "Key": "USERAGENT",
 "Value": "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
 }
 ]
 },
 {
 "Fields": [
 {
 "Key": "TEXT",
 "Value": "Your consent text goes here."
 },
 {
 "Key": "DATETIMECONSENTED",
 "Value": "2020-01-01T09:40:18.527Z"
 },
 {
 "Key": "URL",
 "Value": "http://www.example.com/signup"
 },
 {
 "Key": "IPADDRESS",
 "Value": "127.0.0.1"
 },
 {
 "Key": "USERAGENT",
 "Value": "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
 }
 ]
 }
 ]

 

How can I import this json correctly to the request and response section?

Thanks.

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,631 on at

    Hi @WilsonWan 

     

    Your JSON is almost correct. You need to enclose everything with { } to make it valid.

     

    Try the following:

    {
    	"ConsentFields": [{
    			"Fields": [{
    					"Key": "TEXT",
    					"Value": "Your consent text goes here."
    				},
    				{
    					"Key": "DATETIMECONSENTED",
    					"Value": "2020-01-01T09:40:18.527Z"
    				},
    				{
    					"Key": "URL",
    					"Value": "http://www.example.com/signup"
    				},
    				{
    					"Key": "IPADDRESS",
    					"Value": "127.0.0.1"
    				},
    				{
    					"Key": "USERAGENT",
    					"Value": "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
    				}
    			]
    		},
    		{
    			"Fields": [{
    					"Key": "TEXT",
    					"Value": "Your consent text goes here."
    				},
    				{
    					"Key": "DATETIMECONSENTED",
    					"Value": "2020-01-01T09:40:18.527Z"
    				},
    				{
    					"Key": "URL",
    					"Value": "http://www.example.com/signup"
    				},
    				{
    					"Key": "IPADDRESS",
    					"Value": "127.0.0.1"
    				},
    				{
    					"Key": "USERAGENT",
    					"Value": "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
    				}
    			]
    		}
    	]
    }

     

    and you'll get

    {
     "type": "object",
     "properties": {
     "ConsentFields": {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "Fields": {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "Key": {
     "type": "string"
     },
     "Value": {
     "type": "string"
     }
     },
     "required": [
     "Key",
     "Value"
     ]
     }
     }
     },
     "required": [
     "Fields"
     ]
     }
     }
     }
    }

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    ​
    Cheers
    Manuel

     

     

     

  • WilsonWan Profile Picture
    8 on at

    Hello @manuelstgomes ,

     

    I have enclosed my json when I was trying to create the action with the json. I have also try the one you provided (which is identical to what I have used).

     

    When the request parameters are created, I get an empty body. There are no properties in the body at all.

     

    Thanks.

  • manuelstgomes Profile Picture
    6,631 on at

    HI @WilsonWan 

     

    Here are the steps I followed:

     

    Copy the JSON to "Generate From Sample":

    Screenshot 2020-01-20 at 10.43.59.png

     

    And then I got the schema:

    Screenshot 2020-01-20 at 10.44.06.png

     

    Did you do anything differently? If would work.

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    ​
    Cheers
    Manuel

  • WilsonWan Profile Picture
    8 on at

    Hello @manuelstgomes ,

     

    Sorry, the area I had issue with is inside the Custom connectors.

     

    Data from sidebar > Custom connectors > Definition in breadcrumb > Actions

     

    When creating a new action, I use the json provided under the Request section > import from sample.

     

    Normally, the body of the request will be populated with the properties from the Json I have given.

     

    However, for some reason, it was empty.

     

    Thanks

  • manuelstgomes Profile Picture
    6,631 on at

    Hi @WilsonWan 

     

    Yeah, you mentioned that, sorry about that.

     

    Have you tried copying the definition that I posted above (below the JSON) to your custom connector? With that, are you able to proceed?

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    ​
    Cheers
    Manuel

  • WilsonWan Profile Picture
    8 on at

    Hello @manuelstgomes 

     

    I believe that the action is expecting a json, not definition.

     

    after importing the definition rather than the json, I get this which isn't what I expect from the json.

     

    image.png

     

    Thanks

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi did u solve this one ?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 632

#2
Haque Profile Picture

Haque 458

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard