Need help on how to display all the rows of a column

Hi,

I have a DB table which has two columns,that is, ID and VALUE columns

And there are 5 rows.

My requirement is how to display (Value Columns) different values in five rich texts as their names.

Thanks

Faisal

  Discussion posts and replies are publicly visible

Parents
  • I am using the below codes..It is ok?

    a!localVariables(
    local!empData:rule!FF_EMP_QE_EmpType(typeId: null),
    {a!columnsLayout(
    columns: {
    a!columnLayout(
    contents: {
    a!cardLayout(
    contents: a!richTextDisplayField(
    value: {
    a!richTextIcon(
    icon: "money",
    color: "ACCENT",
    size: "LARGE"
    ),
    char(10),
    a!richTextItem(
    text: a!forEach(items: local!empData,
    expression: fv!item.emptype)[1],
    /*text: local!empData[1].emptype*/

    size: "LARGE")

    },
    align: "CENTER"
    ),
    /* Setting this variable would be used to navigate to a category of answers */
    /*link: a!dynamicLink(saveInto: a!save(local!category, "Finance")),*/
    height: "AUTO",
    marginBelow: "STANDARD"
    )})})})

  • 0
    Certified Lead Developer
    in reply to faisalf0003
    a!forEach(items: local!empData,
    expression: fv!item.emptype)[1],

    I'm not really sure what you're trying to do here, but this specific piece of code will manually index the first ([1]) result of the array generated by the a!forEach() loop, basically making it meaningless.  I think it might be closer to your desired end result just by removing the "[1]".

    Also: for code like this (or any SAIL or expression code really) I strongly suggest inserting your code into a Code Box ("Insert" --> "Insert Code" in the in-editor menu here), as this retains formatting like indentation and uses an easier font for reading code.  When asking others to review your code it's a good idea to make it as easy to read as you can.

Reply
  • 0
    Certified Lead Developer
    in reply to faisalf0003
    a!forEach(items: local!empData,
    expression: fv!item.emptype)[1],

    I'm not really sure what you're trying to do here, but this specific piece of code will manually index the first ([1]) result of the array generated by the a!forEach() loop, basically making it meaningless.  I think it might be closer to your desired end result just by removing the "[1]".

    Also: for code like this (or any SAIL or expression code really) I strongly suggest inserting your code into a Code Box ("Insert" --> "Insert Code" in the in-editor menu here), as this retains formatting like indentation and uses an easier font for reading code.  When asking others to review your code it's a good idea to make it as easy to read as you can.

Children
No Data