Hi, I'm trying applyComponents function on rich text items (such as a!richTe

Hi, I'm trying applyComponents function on rich text items (such as a!richTextItem, a!richTextNumberedList, etc) by applying it on the 'value' of a!richTextField but it doesn't return anything at all. Does applyComponents doesn't work on rich text items?

Below is the snippet of my codes.

OriginalPostID-218581

OriginalPostID-218581

  Discussion posts and replies are publicly visible

Parents
  • If you change the expression rule "loopingRichTextItem" in to an interface may be you will get more clarity from the error it throws which is as follows:

    "Interface Definition: Expression evaluation error: An array of components may only contain components. Received FormattedText at index 1."

    So, to my understanding appian not not treating a!richTextItem as an independent component. It also states the same in the forum help i.e. "Displays styled text within a rich text(i.e a!richTextDisplayField) component."
    So you have to use a!richTextItem within a!richTextDisplayField if you want to use them in loops as a component.

    So the solution to this scenario is use a!richTextDisplayField inside the "loopingRichTextItem" rule and iterate it from the main interface. Please refer the below code snippet.

    loopingRichTextItem():
    a!richTextDisplayField(
    label: "Test",
    value:
    {
    a!richTextItem(
    text: "Test " & ri!header,
    style: "NORMAL"
    ),
    a!richTextNumberedList(
    items:{
    ri!detail
    }
    )
    }
    )

    Let me know if the information is helpful.



Reply
  • If you change the expression rule "loopingRichTextItem" in to an interface may be you will get more clarity from the error it throws which is as follows:

    "Interface Definition: Expression evaluation error: An array of components may only contain components. Received FormattedText at index 1."

    So, to my understanding appian not not treating a!richTextItem as an independent component. It also states the same in the forum help i.e. "Displays styled text within a rich text(i.e a!richTextDisplayField) component."
    So you have to use a!richTextItem within a!richTextDisplayField if you want to use them in loops as a component.

    So the solution to this scenario is use a!richTextDisplayField inside the "loopingRichTextItem" rule and iterate it from the main interface. Please refer the below code snippet.

    loopingRichTextItem():
    a!richTextDisplayField(
    label: "Test",
    value:
    {
    a!richTextItem(
    text: "Test " & ri!header,
    style: "NORMAL"
    ),
    a!richTextNumberedList(
    items:{
    ri!detail
    }
    )
    }
    )

    Let me know if the information is helpful.



Children
No Data