Forum Discussion

kqarmout's avatar
kqarmout
New Member
5 years ago
Solved

POST request In PQ Expression Error: 3 arguments were passed to a function which Details: Pattern =

I have made a post request using power querst but I receive this message error.

 

Expression.Error: 3 arguments were passed to a function which expects between 1 and 2.
Details:
Pattern=
Arguments=[List]

 

the code as the follwoing

 

------------------------------------------------------------------------------------------------------------------------

let

 

header= [#"ID" = "username", #"TOKEN" = "password", #"Content-Type" = "application/json; charset=utf-8"],

 

Body = [P_CITIZEN_ID= "inquery ID number"],

 

 

webdata = Web.Contents("url", [Headers=header,Query= P_CITIZEN_ID], [Content =Text.ToBinary(Body)]),

 

response = Json.Document(webdata)

 

in

 

response

---------------------------------------------------------------------------------------------

the authinticaiton is basic so no need for auth2.

 

information should be include in Postman are:

params = P_CITIZEN_ID

body = P_CITIZEN_ID

header = ID = "as username", token = "password"

 

the output should be result as being in postman

coloumn named status = (fail or success).

coloumn named GET_staff_information = (result should be record)

 

postman response

{
    "status""success",
    "GET_staff_information": [
        {
            "staff_ID""number",
            "staff_NAME""name",
             "C_NAME""area name"
        }
    ]
}

 

 

 

  • I found the solution and I will publish it later, I'm afraid to tell you, you have not solved the problem 

3 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion
    webdata = Web.Contents("url", [Headers=header, Query=P_CITIZEN_ID, Content=Text.ToBinary(Body)])
    • kqarmout's avatar
      kqarmout
      New Member

      I found the solution and I will publish it later, I'm afraid to tell you, you have not solved the problem 

      • CNENFRNL's avatar
        CNENFRNL
        Community Champion

        hmm.... sounds weird to me, I don't need any solution to your issue.