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 / 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,625 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,625 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,625 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
    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

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard