Web API to Update Data of DB

Certified Lead Developer
Hi,
I have a requirement where i need to Update the data of the Database using Web-API, for that i created a Web API using POST method having a!writeToDataStoreEntity() function configured.

Problem Statement:- when i pass the JSON Format data into body field of Web API, it works Well, but whenever i am trying to do the same using an Expression rule where i have defined a rule input of type text where specified value is the same JSON which i used earlier, then nothing gets Update in database and also no log informations about it, and it returns Writer Type followed by following Value
[name=httpwriter_appian_internal, parameters=http://localhost:port/suite/webapi/storeEmployee; POST; ; ; [username=[externalSystemKey=mycredentials, fieldKey=username, usePerUser=false], password=[externalSystemKey=mycredentials, fieldKey=password, usePerUser=false], preemptive=true];followed by Data
...

OriginalPostID-244534

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    ...
    Below is the code which i have written inside Expression rule
    ====================================================
    load(

    /*local!a: bind(
    get: "null",
    set: */a!httpWrite(

    url: "localhost:myPortNumber/.../storeEmployee",
    method: "POST",
    body: /*a!toJson(*/
    ri!empDetails
    /*)*/,
    basicAuthenticationCredentials: a!httpAuthenticationBasic(
    username: a!scsField(
    externalSystemKey: "mycredentials",
    fieldKey: "username"
    ),
    password: a!scsField(
    externalSystemKey: "mycredentials",
    fieldKey: "password"
    ),
    preemptive: true
    )
    )/*
    ),
    local!a*/
    )
    =========================================================
    Also when i uncomment bind() then getting following error, Expression evaluation error at function 'bind' [line 5]: Invalid parameter: the parameter given as the 'set' parameter to the function 'bind' must not be nu...
Reply
  • 0
    Certified Lead Developer
    ...
    Below is the code which i have written inside Expression rule
    ====================================================
    load(

    /*local!a: bind(
    get: "null",
    set: */a!httpWrite(

    url: "localhost:myPortNumber/.../storeEmployee",
    method: "POST",
    body: /*a!toJson(*/
    ri!empDetails
    /*)*/,
    basicAuthenticationCredentials: a!httpAuthenticationBasic(
    username: a!scsField(
    externalSystemKey: "mycredentials",
    fieldKey: "username"
    ),
    password: a!scsField(
    externalSystemKey: "mycredentials",
    fieldKey: "password"
    ),
    preemptive: true
    )
    )/*
    ),
    local!a*/
    )
    =========================================================
    Also when i uncomment bind() then getting following error, Expression evaluation error at function 'bind' [line 5]: Invalid parameter: the parameter given as the 'set' parameter to the function 'bind' must not be nu...
Children
No Data