columns combine

Certified Associate Developer

Hii All,

I am working on Audit log using CDT comparsion plugin and tha data comes in grid like that:

Now I want to combine fieldname column and previous value column like that:

Province : NL

Thanks 

  Discussion posts and replies are publicly visible

  • concat(fv!row.fieldName," : ",fv!row.previousValue)

  • 0
    Certified Associate Developer
    in reply to Harshit Bumb (Appyzie)

    Hii Harshit,

    The above concat function is not working fine.Its gives the output like:

    but I want like that:

    status: In progess

    date_completed:2023-01-03

    comments:xyz

  • 0
    Appian Employee
    in reply to jojog0003

    I think you'll need to post some of your code so we can see what you're doing here and provide suggestions.

  • 0
    Certified Associate Developer
    in reply to Peter Lewis

    Hii peter,

    I am using one expression rule and interface.

    The code for expression rule given below:

    a!localVariables(
      local!data: cdtcomparison(ri!oldCDT, ri!newCDT),
      local!newCopaCaseData: a!forEach(
        items: local!data,
        expression: if(fv!item.isDifferent = true, fv!item, {})
      ),
      local!newdata: remove(
        local!newCopaCaseData,
        wherecontains(
          { "id",
            "createdOn",
            "updatedOn",
            "createdBy",
            "updatedBy",
            "isDeleted",
            "userGroup",
            "challenged"
          },
          property(local!newCopaCaseData,"attributeName",null())
        )
      ),
      local!commentsData: cdtcomparison(ri!oldCommentCDT, ri!newCommentCDT),
      local!newCommentsData: a!forEach(
        items: local!commentsData,
        expression: if(fv!item.isDifferent = true, fv!item, {})
      ),
      local!comment: remove(
        local!newCommentsData,
        wherecontains(
          { "id", "caseId", "commentBy", "commentOn" },
          property(local!newCommentsData,"attributeName",null())
        )
      ),
      local!commentSpace:if(length(a!flatten(local!comment))>0,char(10),""),
      local!TimeEntryData: cdtcomparison(ri!oldTimeEntryCDT, ri!newTimeEntryCDT),
      local!newTimeEntryData: a!forEach(
        items: local!TimeEntryData,
        expression: if(fv!item.isDifferent = true, fv!item, {})
      ),
      local!TimeEntry: remove(
        local!newTimeEntryData,
        wherecontains(
          {
            "id",
            "caseId",
            "agent",
            "activityDate",
            "activityType"
          },
          property(local!newTimeEntryData,"attributeName",null())
        )
      ),
      local!attributeName: joinarray(local!newdata.attributeName, char(10)),
      local!previousValue: joinarray(local!newdata.previousValue, char(10)),
      local!currentValue: joinarray(local!newdata.currentValue, char(10)),
      'type!{urn:com:appian:types:CDM2}CDM2_ActivityLog_CopaCase'(
        caseid: ri!recordId,
        actionby: ri!who,
        action: ri!action,
        attributeName:append(
          local!attributeName &  local!commentSpace & property(local!comment,"attributeName",null())&  char(10) &property(local!TimeEntry,"attributeName",null())),
          
        
        PreviousValue:append(
          local!previousValue & local!commentSpace & property(local!comment,"previousValue",null()) &  char(10) & property(local!TimeEntry,"previousValue",null()))
        ,
        currentValue:append(
          local!currentValue & local!commentSpace & property(local!comment,"currentValue",null()) & char(10)& property(local!TimeEntry,"currentValue",null())
        ),
        actionedOn: now(),
        
      ),
      
    )

  • 0
    Certified Lead Developer
    in reply to jojog0003

    This really hinges on the output of "cdtComparison()" which is from a plug-in i'm not familiar with.  What data structure results from running that rule for the two given CDTs?