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 Apps / Custom Connector: PUT/...
Power Apps
Unanswered

Custom Connector: PUT/POST/Body Syntax?

(0) ShareShare
ReportReport
Posted on by 48

When using a Custom Connector, what's the property syntax to add content to the Body? 

 

For example: MyAPI.Update("Lead","ID") is used to update, but how do I append the Body into the action?

Categories:
I have the same question (0)
  • Ionaaa Profile Picture
    94 on at

    MyApi.Update(
      {
        Property1: "Some value",

        Property2: "Some other value"
      }
    )

    Within the Custom connector definition, you should have built the body that is to be expected by the API you are calling.

  • oguruma Profile Picture
    48 on at

    How do you "build the body"? Is there not a way to simply pass in a JSON array of values to update?

     

    The API I'm using simply requires a JSON objects you wish to update. For example when I put the following into the Body (raw) using the Custom Connector tester

     

    {"first_name":"Henry","middle_name":"Francis","last_name":"Dover"}

     

    it updates the first, middle, and last names. 

     

    Is there a way to use PowerApps to send Raw Body with the API call? 

     

     

     

    The Swagger for the method is 

     put:
     description: TBD
     summary: Update a specific document
     tags: [RESTful API]
     operationId: Updateaspecificdocument
     deprecated: false
     produces: [application/json, text/html]
     consumes: [application/json]
     parameters:
     - {name: DocType, in: path, required: true, type: string, default: '', description: "The\
     \ DocType you'd like to receive. For example Customer, Supplier, \nEmployee,\
     \ Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry,\
     \ etc."}
     - {name: DocumentName, in: path, required: true, type: string, default: '',
     description: The name (ID) of the document you'd like to update. For example
     EMP001 (of type Employee).}
     - name: Content-Type
     in: header
     required: false
     enum: [application/json]
     type: string
     description: ''
     - name: body
     in: body
     required: false
     description: ''
     schema: {type: object, x-ms-visibility: important}
     x-ms-visibility: important
     responses:
     default:
     description: default
     schema:
     type: object
     properties:
     name: {type: string, description: name}
     owner: {type: string, description: owner}
     creation: {type: string, description: creation}
     modified: {type: string, description: modified}
     modified_by: {type: string, description: modified_by}
     docstatus: {type: integer, format: int32, description: docstatus}
     idx: {type: integer, format: int32, description: idx}
     naming_series: {type: string, description: naming_series}
     salutation: {type: string, description: salutation}
     first_name: {type: string, description: first_name, title: '', x-ms-visibility: important}
     middle_name: {type: string, description: middle_name}
     last_name: {type: string, description: last_name, title: '', x-ms-visibility: important}
     lead_name: {type: string, description: lead_name}
     job_title: {type: string, description: job_title}
     gender: {type: string, description: gender}
     source: {type: string, description: source}
     
  • Community Power Platform Member Profile Picture
    on at

    Hello, I know this is a little late but I hope this helps anybody who is dealing with the same issue, regarding the question of sending a raw JSON object, I was able to do that by just adding empty JSON object in the Import of an action:

    StefanEyd_0-1694766479046.png

    Then in Power Automate I use Compose to construct the JSON object:

    StefanEyd_1-1694766849616.png

    And it works:

    StefanEyd_2-1694767001583.png

     

  • petecarl Profile Picture
    6 on at

    And for anyone trying to do this in PowerApps

     

    Once the connector is setup like above and added to PA its expecting an UnTypedObject so when calling the custom connector in PowerApps this is the syntax I used

    Set(varBody,ParseJSON("MyJsonString"))

    Set(varResponse,CustomConnectorName.Action({body:varBody}));

     

    or if you have constructed a record or collection in PowerApps already that you need to convert to an UnTypedObject, Use the JSON() function nested inside the ParseJSON() function, like so:

     

    Set(varBody,ParseJSON(JSON(varMyRecordOrCollection)))

    Set(varResponse,CustomConnectorName.Action({body:varBody}));

  • Rajath_mk Profile Picture
    93 on at

    @StefanEyd 

    Thanks for that, I had a custom connector that had an array that keeps changing and can't be defined. Unfortunately, I need to trigger this on-prem and cant use the HTTP trigger.

     

    By giving the body for the POST action as { }, I was able to use the custom connector without issues. 

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard