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 Apps / problem with Sending t...
Power Apps
Answered

problem with Sending the corret data to the server

(0) ShareShare
ReportReport
Posted on by 99

Hello


we are trying to develop one simple PowerApps app but we cannot manage to send the data in the right format on our server.

So our server expect a data like this " { "parameters": [ { "param1": 3 , "param2": 2 } ] }"

we tryied with the Table, collection and the closest we achieve is "{ "param1": 3 , "param2": 2 }" , we still miss some piece that need to be send to the server.

How we can achieve that this is send correctly on the server?

-> in this format: { "parameters": [ {"param1": 3 ,"param2": 2 } ] }

Thank you
Cheers

Categories:
I have the same question (0)
  • rgruian Profile Picture
    Microsoft Employee on at

    The following formula will produce what you want:

     

        { parameters: Table( { param1: 3, param2: 2 } ) }

     

    Please avoid string syntax (double quotes) for field names. In the PowerApps Language, field names are identifiers. The only identifiers that require additional decorations are those with blank or non-alphanumeric characters, in which case the single-quote syntax needs to be used. For example, { 'parameters for this query' : { 'a b c' : 2, 'd e f g' : "some text" }

     

    I hope this helps.

  • mob Profile Picture
    99 on at

    Unfortunally is not working....

    I get the error: THE FUNCTION HAS SOME INVALID ARGUMENTS

     

    error powerapps.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    here is one part of the swagger file:

     

    "operationId": "ApiadditionPost",
    "produces": [
         "application/json"
     ],
    "parameters": [
        {
           "name": "Body",
           "in": "body",
           "required": true,
           "x-is-map": false,
           "schema": {
           "title": "toexportRequest",
           "type": "object",
           "properties": {
                    "param1": {
                              "type": "number"
                       },
                     "param2": {
                             "type": "number"
                       }
              }.....................

     

     

     

    Basically when we run the server with the debugger, we can see that ther server expects this:
    {"parameters":[{"param1":3,"param2":2}] }

     

    this shows no error:    .ApiadditionPost( { param1: Value(TextInput1.Text), param2: Value(TextInput2.Text) } )

     

    but on the server is then: {"param1":3,"param2":2}

     

    so we still miss this part: {"parameters":[ ...... ]}

     

     

    We tried everything, Table , Collection, .... everything that came up to our mind, but no success..... Also in the documentation we found nothing similar.

     

     

    Do you have some ideas what else we could try?

     

     

    Thank you

    Cheers

  • Verified answer
    rgruian Profile Picture
    Microsoft Employee on at

    The syntax that I specified should work, assuming that the declaration of your custom API function is correct.

     

    The fact that it currently accepts simply: { param1: Value(...), param2: Value(...) } without red squiggles / errors indicates that the API declaration itself is incorrect, and it specifies an incorrect type for the function parameter.

     

    The formula:

        { parameters: Table( { param1: 1, param2: 2 }) }

     

    will produce the following data:

        { parameters: [ { param1: 1, param2: 2 } ] }

     

    The API function has to be declared as taking an arg that has that exact type: { parameters: [ { param1: _, param2: _ } ] }

     

    I hope this helps.

  • Verified answer
    rgruian Profile Picture
    Microsoft Employee on at

    Also, what does Intellisense show when you type the name of your function and open a parenthesis?

    In looking at your Swagger content, it seems like you are declaring "parameters" to be a required parameter, which cannot be specified in this fashion in the function invocation. Required parameters typically become separate function arguments, so you would need to pass the following to your function:

     

        func(Table({ param1: 1, param2: 2}))

     

    Try changing "required" to false, re-deploy your API, and then re-try the invocation I suggested previously:

     

       func({ parameters: Table( . . .) })

     

     

  • mob Profile Picture
    99 on at

    Thank you very much!

     

    So I changed the api like you suggested and I can finally retrieve data from the server!

     

    I changed required to false, and changed a little bit the parameters and it works!

     

     

    I think that should work also with more complicated queries that we have, if not I will write here the problem!

     

     

     

  • rgruian Profile Picture
    Microsoft Employee on at

    Excellent, thanks for reporting back, I am glad to hear that you are unblocked.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard