How to reference process backed record field that is of image type derived by expression rule in the interface

Hi,

I have a process backed record and one of the column/field is of image type derived by expression rule as listed below:

a!documentImage(
rule!MP_getOverdueIndicator(rf!MilestoneScheduleTasks.NotApplicable,rf!MilestoneScheduleTasks.ProjEndDate,rf!MilestoneScheduleTasks.ActEndDate,rf!overdueInt)
)

How do i reference this field in the interface? i can use a!gridImageColumn but what would be the field i refer to in the local!datasubset.data. Any help is appreciated.

Thanks,

Meena

  Discussion posts and replies are publicly visible

Parents
  • Can you explain which interface you want to display this field on?

    • If you want to display this in the record list, what you have above should work fine
    • If you want to display this in the summary view, you should one or more rule inputs and reference the fields using ri!
    • If you want to display this outside of your record (e.g. on a report), then you would query the data first, store it in a local variable, and reference it using local!
  • Hi Peter,

    I want to display this on a interface/report. Currently, i tried doing these in diff. ways, but looks like it couldn't get the nested values. 

    /*a!gridImageColumn(
    label: "Indicator",
    field: "overDueInt",
    data: if(isnull(local!datasubset.data),"",a!documentImage(apply(rule!MP_getOverdueIndicator,
    index(index(local!datasubset.data,"MilestoneScheduleTasks",{}), "NotApplicable", {}),
    index(index(local!datasubset.data,"MilestoneScheduleTasks",{}), "ProjEndDate", {}),
    index(index(local!datasubset.data,"MilestoneScheduleTasks",{}), "ProjEndDate", {}),
    index(local!datasubset.data,"overdueInt",{}))
    ))
    ),*/
    a!gridImageColumn(
    label: "Overdue",
    field: "overDueInt",
    data: a!forEach(
    items: local!dataSubset.data,
    expression: if(isnull(fv!item),"",
    a!documentImage(rule!MP_getOverdueIndicator(
    index(index(fv!item,"MilestoneScheduleTasks",{}),"NotApplicable",{}),
    index(index(fv!item,"MilestoneScheduleTasks",{}),"ProjEndDate",{}),
    index(index(fv!item,"MilestoneScheduleTasks",{}),"ActEndDate",{}),
    fv!item.overdueInt)))
    )
    ),

    a!gridImageColumn(
    label: "OverdueNew",
    field: "overDueInt",
    data: a!forEach(
    items: local!dataSubset.data,
    expression: if(isnull(fv!item),"",
    a!documentImage(rule!MP_getOverdueIndicator(
    property(fv!item.MilestoneScheduleTasks,"NotApplicable",{}),
    property(fv!item.MilestoneScheduleTasks,"ProjEndDate",{}),
    property(fv!item.MilestoneScheduleTasks,"ActEndDate",{}),
    fv!item.overdueInt)))
    )
    ),

    My question is , instead of applying the rule to the data set again , how do i reference the derived record field in the interface?

    Thanks,

    Meena

  • I'm assuming you defined the "derived" field as a column in your record list grid? Appian doesn't really have the concept of a derived field, so there isn't a way to reference the data from that column elsewhere. That being said, you should still be able to run the same rule again like you suggested above. Does that not work? Are you receiving an error when running the expression above?

  • +1
    Certified Lead Developer
    in reply to meenakshir

    We don't really have any easy way to tell what your CDT that holds "MilestoneScheduleTasks" looks like.  But in general my suggestion is, instead of just trying random things in a Grid until it works, just add a "debug" paragraph field and set the value to the variable holding the data you're trying to show, and see which (if any) fields it's showing there, and use that to inform the logic for your grid.

    Also as an aside, when inserting a big code block like that, it would be helpful just from a formatting and readability perspective, to use the "Insert --> Insert Code" functionality provided here on Community.

  • Not getting an error but looks like the values are null for nested fields and hence the rule output value is not what is expected.

  • +1
    Certified Lead Developer
    in reply to meenakshir

    How are you populating local!dataSubset?  Does it even contain any of the expected values, when you display its value in a paragraph field as I mentioned above?

  • Thanks Mike for the debug suggestion. Yes, it had most fields but one of the field was missing in the datasubset. Added to the queryselection/querycolumn and now it works like a charm Slight smile

    Thanks again for your help!

  • +1
    Certified Lead Developer
    in reply to meenakshir

    Thanks for confirming - if you get a chance, it'd be appreciated if you would upvote and/or click verify on one or more of my above replies :)

Reply Children
No Data