Display data from database view into interface

Hello Everyone,

I would like to display data from database view into interface without using grid. Can anyone please help me how to achieve this, the displayed must be editable as well.

Thank You.

  Discussion posts and replies are publicly visible

Parents
  • Hey,

    If your use case is to try different components to display the DB items in a more presentable way, you can use the card layout as grid. Please find the below code snippet from Appian documentation to achieve having card layout as background. Similarly, you can run the card layout in foreach() with alternative colors.

    docs.appian.com/.../card_layout.html

    a!localvariables(
      local!salesLeaders: {
        a!map(rank: "1st", name: "Cindy Pratt", revenue: "$3.72M"),
        a!map(rank: "2nd", name: "Kyong-Ok Yi", revenue: "$2.94M"),
        a!map(rank: "3rd", name: "Linda Smith", revenue: "$2.51M")
      },
      a!headerContentLayout(
        header: {},
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!cardLayout(
                    contents: {
                      a!sectionLayout(
                        contents: {
                          a!richTextDisplayField(
                            labelPosition: "COLLAPSED",
                            value: {
                              a!richTextItem(
                                text: upper("Sales Revenue Leaderboard"),
                                color: "STANDARD",
                                size: "MEDIUM",
                                style: "STRONG"
                              )
                            }
                          ),
                          /* Displays a row for each sales leader */
                          a!forEach(
                            items: local!salesLeaders,
                            expression: a!sideBySideLayout(
                              items: {
                                a!sideBySideItem(
                                  item: a!richTextDisplayField(
                                    labelPosition: "COLLAPSED",
                                    value: {
                                      a!richTextItem(
                                        text: fv!item.rank,
                                        color: "STANDARD",
                                        size: "MEDIUM",
                                        style: "STRONG"
                                      )
                                    }
                                  ),
                                  width: "2X"
                                ),
                                a!sideBySideItem(
                                  item: a!imageField(
                                    labelPosition: "COLLAPSED",
                                    images: a!userImage(),
                                    size: "SMALL",
                                    isThumbnail: false,
                                    style: "AVATAR"
                                  ),
                                  width: "MINIMIZE"
                                ),
                                a!sideBySideItem(
                                  item: a!richTextDisplayField(
                                    labelPosition: "COLLAPSED",
                                    value: {
                                      a!richTextItem(
                                        text: fv!item.name,
                                        size: "MEDIUM",
                                        style: "STRONG"
                                      )
                                    }
                                  ),
                                  width: "8X"
                                ),
                                a!sideBySideItem(
                                  item: a!richTextDisplayField(
                                    labelPosition: "COLLAPSED",
                                    value: {
                                      a!richTextItem(
                                        text: fv!item.revenue,
                                        color: "STANDARD",
                                        size: "MEDIUM_PLUS"
                                      )
                                    },
                                    align: "RIGHT"
                                  ),
                                  width: "MINIMIZE"
                                )
                              },
                              alignvertical: "MIDDLE"
                            )
                          )
                        },
                        marginBelow: "NONE"
                      )
                    },
                    height: "AUTO",
                    style: "CHARCOAL_SCHEME",
                    padding: "STANDARD",
                    showBorder: false
                  )
                },
                width: "MEDIUM_PLUS"
              )
            }
          )
        },
        backgroundColor: "CHARCOAL_SCHEME"
      )
    )

Reply
  • Hey,

    If your use case is to try different components to display the DB items in a more presentable way, you can use the card layout as grid. Please find the below code snippet from Appian documentation to achieve having card layout as background. Similarly, you can run the card layout in foreach() with alternative colors.

    docs.appian.com/.../card_layout.html

    a!localvariables(
      local!salesLeaders: {
        a!map(rank: "1st", name: "Cindy Pratt", revenue: "$3.72M"),
        a!map(rank: "2nd", name: "Kyong-Ok Yi", revenue: "$2.94M"),
        a!map(rank: "3rd", name: "Linda Smith", revenue: "$2.51M")
      },
      a!headerContentLayout(
        header: {},
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!cardLayout(
                    contents: {
                      a!sectionLayout(
                        contents: {
                          a!richTextDisplayField(
                            labelPosition: "COLLAPSED",
                            value: {
                              a!richTextItem(
                                text: upper("Sales Revenue Leaderboard"),
                                color: "STANDARD",
                                size: "MEDIUM",
                                style: "STRONG"
                              )
                            }
                          ),
                          /* Displays a row for each sales leader */
                          a!forEach(
                            items: local!salesLeaders,
                            expression: a!sideBySideLayout(
                              items: {
                                a!sideBySideItem(
                                  item: a!richTextDisplayField(
                                    labelPosition: "COLLAPSED",
                                    value: {
                                      a!richTextItem(
                                        text: fv!item.rank,
                                        color: "STANDARD",
                                        size: "MEDIUM",
                                        style: "STRONG"
                                      )
                                    }
                                  ),
                                  width: "2X"
                                ),
                                a!sideBySideItem(
                                  item: a!imageField(
                                    labelPosition: "COLLAPSED",
                                    images: a!userImage(),
                                    size: "SMALL",
                                    isThumbnail: false,
                                    style: "AVATAR"
                                  ),
                                  width: "MINIMIZE"
                                ),
                                a!sideBySideItem(
                                  item: a!richTextDisplayField(
                                    labelPosition: "COLLAPSED",
                                    value: {
                                      a!richTextItem(
                                        text: fv!item.name,
                                        size: "MEDIUM",
                                        style: "STRONG"
                                      )
                                    }
                                  ),
                                  width: "8X"
                                ),
                                a!sideBySideItem(
                                  item: a!richTextDisplayField(
                                    labelPosition: "COLLAPSED",
                                    value: {
                                      a!richTextItem(
                                        text: fv!item.revenue,
                                        color: "STANDARD",
                                        size: "MEDIUM_PLUS"
                                      )
                                    },
                                    align: "RIGHT"
                                  ),
                                  width: "MINIMIZE"
                                )
                              },
                              alignvertical: "MIDDLE"
                            )
                          )
                        },
                        marginBelow: "NONE"
                      )
                    },
                    height: "AUTO",
                    style: "CHARCOAL_SCHEME",
                    padding: "STANDARD",
                    showBorder: false
                  )
                },
                width: "MEDIUM_PLUS"
              )
            }
          )
        },
        backgroundColor: "CHARCOAL_SCHEME"
      )
    )

Children
No Data