Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Answered

Flow is removing duplicate objects in body JSON in custom connector

(0) ShareShare
ReportReport
Posted on by 166

Building a custom connector to another web app that we use. Basically, the JSON looks like this according to their documentation:

{
 "workspace": {
 "title": "string",
 "creator_role": "string",
 "custom_fields": [
 {
 "custom_field_id": 0,
 "value": "string"
 }
] } }

However, there are multiple "custom_fields", so it should be more like this:

{
 "workspace": {
 "title": "string",
 "creator_role": "string",
 "custom_fields": [
 {
 "custom_field_id": 0,
 "value": "string"
 },
 {
 "custom_field_id": 0,
 "value": "string"
 },
 {
 "custom_field_id": 0,
 "value": "string"
 }
 ]
 }
}

And would eventually be something like this:

{
 "workspace": {
 "title": "Test Title",
 "creator_role": "admin",
 "custom_fields": [
 {
 "custom_field_id": 123,
 "value": "Test Custom Field 1"
 },
 {
 "custom_field_id": 456,
 "value": "Test Custom Field 2"
 },
 {
 "custom_field_id": 789,
 "value": "Test Custom Field 3"
 }
 ]
 }
}

However when I drop in the second code snippet, it removes the duplicate "custom_fields". How do I prevent this?

  • ishraqiyun77 Profile Picture
    166 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Ok, I was trying to do this all in the Custom Connect as opposed to inside the Flow itself. Now it seems to work and make sense. Thanks for the help!

  • Verified answer
    yashag2255 Profile Picture
    24,539 Super User 2024 Season 1 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    @ishraqiyun77 

     

    I tried doing just that and it works fine for me. Please see the screenshots below:MicrosoftTeams-image (159).png

     

    MicrosoftTeams-image (158).png

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • ishraqiyun77 Profile Picture
    166 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Ok, again, it seems like I am missing something. This is what I get when I "+ Import from sample" using that snippet:

    Capture.PNG

    It removes the duplicates. I need to send like 25 custom_field_id and value objects in that array.

     

    This is what the Test Operations looks like. Again, they are not there for me to pass values into.

    Capture1.PNG

    Yeah, I can modify the body and manually add them back in before the test, but I don't know how this helps me when finalizing the connector and actually using it in a flow. Those additional 25 or so custom_fields will likely not be available.

    Capture2.PNG

    So I am missing something...

  • yashag2255 Profile Picture
    24,539 Super User 2024 Season 1 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Hi @ishraqiyun77 

     

    Please see the screenhots below:MicrosoftTeams-image (151).png

     

    MicrosoftTeams-image (152).png

     

    I did a test on my end and you need to pass below schema while creating your request in custom connector.
    {
      "workspace": {
        "title": "Test Title",
        "creator_role": "admin",
        "custom_fields": [
          {
            "custom_field_id": 123,
            "value": "Test Custom Field 1"
          },
          {
            "custom_field_id": 456,
            "value": "Test Custom Field 2"
          },
          {
            "custom_field_id": 789,
            "value": "Test Custom Field 3"
          }
        ]
      }
    }
    It will create 4 parameters each for title,creator's role,  custom_field_id and value. I tried to pass custom_fields as an array while testing out this and it returned me the correct response.
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • ishraqiyun77 Profile Picture
    166 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Also, another clarification, I am doing this all by adding an Action and then under Request, I am clicking the "+ Import from sample". Perhaps there is a different way I should be doing this, but that much is not clear to me.

  • ishraqiyun77 Profile Picture
    166 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Also, even taking the JSON snippet from here:

    https://blog.mastykarz.nl/what-know-building-microsoft-flow-custom-connectors/

    Results in pretty much the same behavior:

    {
     "properties": {
     "file": {
     "title": "File contents",
     "type": "string",
     "format": "binary"
     }
     }
    }

    image.png

    It seems like it should be populating these fields for one of the properties, but that isn't happening.

    Capture.PNG

    And to point out, when I do something like this:

    {
     "workspace": {
     "title": "string",
     "creator_role": "string",
     "custom_fields": [
     {
     "custom_field_id": 0,
     "value": "string"
     }
    ] } }

     This works as expected. It just removes the duplicate custom_field_id and value which I need in there. So a bit confused on how to approach this.

    image.png

  • ishraqiyun77 Profile Picture
    166 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Hi @yashag2255 

    This is the JSON I am passing in:

    {
     "type": "object",
     "properties": {
     "workspace": {
     "type": "object",
     "properties": {
     "title": {
     "type": "string"
     },
     "creator_role": {
     "type": "string"
     },
     "custom_fields": {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "custom_field_id": {
     "type": "integer"
     },
     "value": {
     "type": "string"
     }
     }
     }
     }
     }
     }
     }
    }
  • yashag2255 Profile Picture
    24,539 Super User 2024 Season 1 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Hi @ishraqiyun77 

     

    Can you please share what you have passed in the body part over there? I am guessing this is happening because you have passed the same key for all the body items.

  • ishraqiyun77 Profile Picture
    166 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Ok, perhaps I'm doing something wrong...

    Just using your snippet below results in the following:

    Capture.PNGCapture1.PNG

    It is really non-descript what parameters these correspond with.

  • yashag2255 Profile Picture
    24,539 Super User 2024 Season 1 on at
    Re: Flow is removing duplicate objects in body JSON in custom connector

    Hi @ishraqiyun77 

     

    I would suggest you have a look at this blog:

    https://blog.mastykarz.nl/what-know-building-microsoft-flow-custom-connectors/

     

    The entire process of creating custom connectors and the JSON formatting has been explained well here. 

     

    edit: you can use the JSON Parse data operation action to get the format for any JSON resposne. Just click "Use sample payload to generaet Schema" and add a sample output here. 

    ssdc.png

     

     

    Hope this Helps!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics