How to get the UserName from User Id in a aggregate column function or a rule for filter

a!queryEntity(
  entity: cons!PF_ENTITY_VW_REQUEST,
  query: a!query(
    aggregation: a!queryAggregation(
      aggregationColumns: {
        a!queryAggregationColumn(field: "RequestUserID", isGrouping: true),
        a!queryAggregationColumn(
          field: "RecordID",
          isGrouping: false,
          aggregationFunction: "COUNT"
        )
      }
    ),
    logicalExpression: a!queryLogicalExpression(
      operator: "AND",
      filters: {
        a!queryFilter(field: "RecordID", operator: "not null"),
        if(
          isnull(ri!RequestUserId),
          {},
          a!queryFilter(
            field: "RequestUserID",
            operator: "=",
            value: ri!RequestUserId
          )
        ),
        if(
          isnull(ri!activeStatus),
          {},
          a!queryFilter(
            field: "ActiveStatus",
            operator: "=",
            value: ri!activeStatus
          )
        ),
        if(
          isnull(ri!RecordID),
          {},
          a!queryFilter(
            field: "RecordID",
            operator: "=",
            value: ri!RecordID
          )
        )
      }
    ),
    pagingInfo: if(
      isnull(ri!pagingInfo),
      a!pagingInfo(startIndex: 1, batchSize: - 1),
      ri!pagingInfo
    )
  )
)

Hi Appian team,

Please check above code return for rule expression, it returns two fields one is RequestUserID and other is recordID. I want to fetch Username from UserID which means I have to get one more field as output that is UserName which I should get from user ID. I know there is user() function in-Build, but i do not know where i can use it to fetch username from RequestUserID field.

Can anyone of you help me solve this issue?

Thanks

Sunu Sam

  Discussion posts and replies are publicly visible

Parents Reply
  • HI Harshit,

    Thank you manipulating result is fine as far as i get the output,but am using it in the filter dropdown query which is used to filter the grid data. below is the code i use.

    a!recordFilterList(
    name: "Requestor",
    options: a!forEach(
    items: rule!PF_getRequestorListByFilters1(
    pagingInfo: a!pagingInfo(1, - 1)
    ).data,
    expression: a!recordFilterListOption(
    id: fv!item.RecordID,
    name:fv!item.RequestUserID,
    filter: a!queryFilter(
    field: 'recordType!{f40a3d03-d822-4eed-91ba-6902fa36eab8}PF Request.fields.{RequestUserID}RequestUserID',
    operator: "=",
    value:fv!item.RequestUserID
    )
    )
    )
    )

    the above code is used in record type-userfilter.

    thanks

    Sunu Sam

Children
No Data