Value convertion at the time of data retrival

Hi All,

Thanks in advance!

In the below code , is it possible to return a customized out put/data subset to the calling function of this queryEntity . 

For ex: for the column username which stores appian userid in DB  , need to be converted to Display name @ the time of query and return . same way the date format dueDate need to be changed to custom format .

I dont want to get the datasubset and loop through it to change the required values which is reason of this question. 

a!queryEntity(
entity: cons!MY_ENTITY,
query: a!query(
selection: a!querySelection(
columns: {
a!queryColumn(
field: "id"
),
a!queryColumn(
field: "username"
),
a!queryColumn(
field: "dueDate"
)
}

.........
)
))

 

Thanks

Rajesh

 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi,

    Create a separate rule to process the retrieved data and with the help of apply function.

    apply(
    newrule(_),
    queryentity output
    )
    ......................

    newrule(queryentitydataitem)
    {
    id:<do the processing>, ----eg:queryentitydataitem.id
    username:<get display name of user>, ------------- eg:getDisplayName(queryentitydataitem.username)
    dueDate:<get date in required format> -----------------eg:getDateinFormat(queryentitydataitem.dueDate,format)
    }
    ..


    Hope this helps you..!!
Reply
  • 0
    Certified Lead Developer
    Hi,

    Create a separate rule to process the retrieved data and with the help of apply function.

    apply(
    newrule(_),
    queryentity output
    )
    ......................

    newrule(queryentitydataitem)
    {
    id:<do the processing>, ----eg:queryentitydataitem.id
    username:<get display name of user>, ------------- eg:getDisplayName(queryentitydataitem.username)
    dueDate:<get date in required format> -----------------eg:getDateinFormat(queryentitydataitem.dueDate,format)
    }
    ..


    Hope this helps you..!!
Children