Spacing issue for Event data post using 'labelvalue' array

Certified Senior Developer
I recently updated multiple ‘Post System Event to Feed’ smart services to eliminate the deprecated functions: Tolabelvalue() & Tolabelvaluearray()
An example of the replacement function:
Before: =tolabelvalue(pv!eventDataLabel,pv!eventDataValue)
After: {label: pv!eventDataLabel, value: pv!eventDataValue}
and
Before: =tolabelvaluearray(pv!eventDataLabels_txt,pv!eventDataValues_txt,false())
After: {label: pv!eventDataLabels_txt, value: pv!eventDataValues_txt, false()}

Everything is working as it should now, except the spacing is off (See attached). Is there something I can add to the value I used to get the arrays to align?

OriginalPostID-254298


LabelValue Issue.docx

  Discussion posts and replies are publicly visible

Parents
  • I can't find documentation on tolabelvaluearray() even going back a few Appian versions, but this might help.

    I think you're just not initializing the LabelValue dictionary correctly. Assuming pv!eventDataLabels_txt and pv!eventDataValues_txt are lists, you should apply over a rule that returns your dictionary. Your expression would then be:

    = apply(
    rule!XYZ_labelValue(
    label: _,
    value: _
    ),
    merge(
    pv!eventDataLabels_txt,
    pv!eventDataValues_txt
    )
    )

    XYZ_labelValue would just return {label: ri!label, value: ri!value}.
Reply
  • I can't find documentation on tolabelvaluearray() even going back a few Appian versions, but this might help.

    I think you're just not initializing the LabelValue dictionary correctly. Assuming pv!eventDataLabels_txt and pv!eventDataValues_txt are lists, you should apply over a rule that returns your dictionary. Your expression would then be:

    = apply(
    rule!XYZ_labelValue(
    label: _,
    value: _
    ),
    merge(
    pv!eventDataLabels_txt,
    pv!eventDataValues_txt
    )
    )

    XYZ_labelValue would just return {label: ri!label, value: ri!value}.
Children
No Data