Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Table function

Hello everyone,  

I have a question that table function is created in the database with set of columns and How will I use the table function in appian with some parameters?

Can anyone please help me to further proceed?

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • okay thanks for your reply chris, I am facing difficulties while doing the developement that I will be sharing my code here

    a!gridField(
      labelPosition: "COLLAPSED",
      spacing: "DENSE",
      
      data: ri!ReportCountsViewData_cdt,
      columns: {
        a!gridColumn(
          label: "Summary",
          value: fv!row.reportName_txt
        ),
        a!gridColumn(
          align: "CENTER",
          label: "Due in 60 days",
        
          value: a!richTextDisplayField(
            value: a!richTextItem(
              text: fv!row.due60Days_int,
              linkStyle: "STANDALONE",
              link: a!dynamicLink(
                label: fv!row.due60Days_int,
                value: fv!row.due60Days_int,
                saveInto: {
                  a!save(
                    ri!selectedItemType_txt,
                    "Due in 60 days"
                  ),
                  a!save(
                    ri!selectedItemReportType_txt,
                    fv!row.reportName_txt
                  )
                },
                showWhen: and(
                  not(
                    isnull(
                      tointeger(
                        fv!row.due60Days_int
                      )
                    )
                  ),
                  tointeger(
                    fv!row.due60Days_int
                  ) <> 0
                )
              )
            )
          )
        ),
        a!gridColumn(
          align: "CENTER",
          label: "Due in 30 days",
         
          value: a!richTextDisplayField(
            value: a!richTextItem(
              text: fv!row.due30Days_int,
              linkStyle: "STANDALONE",
              link: a!dynamicLink(
                label: fv!row.due30Days_int,
                value: fv!row.due30Days_int,
                saveInto: {
                  a!save(
                    ri!selectedItemType_txt,
                    "Due in 30 days"
                  ),
                  a!save(
                    ri!selectedItemReportType_txt,
                    fv!row.reportName_txt
                  )
                },
                showWhen: and(
                  not(
                    isnull(
                      tointeger(
                        fv!row.due30Days_int
                      )
                    )
                  ),
                  tointeger(
                    fv!row.due30Days_int
                  ) <> 0
                )
              )
            )
          )
        ),
        a!gridColumn(
          align: "CENTER",
          label: "Past Due in 1-30 days",
          
          value: a!richTextDisplayField(
            value: a!richTextItem(
              text: fv!row.pastdue30Days_int,
              linkStyle: "STANDALONE",
              link: a!dynamicLink(
                label: fv!row.pastdue30Days_int,
                value: fv!row.pastdue30Days_int,
                saveInto: {
                  a!save(
                    ri!selectedItemType_txt,
                    "Past Due in 1-30 days"
                  ),
                  a!save(
                    ri!selectedItemReportType_txt,
                    fv!row.reportName_txt
                  )
                },
                showWhen: and(
                  not(
                    isnull(
                      tointeger(
                        fv!row.pastdue30Days_int
                      )
                    )
                  ),
                  tointeger(
                    fv!row.pastdue30Days_int
                  ) <> 0
                )
              )
            )
          )
        ),
        a!gridColumn(
          align: "CENTER",
          label: "Past Due in 30+ days",
         
          value: a!richTextDisplayField(
            value: a!richTextItem(
              text: fv!row.pastdueOver30Days_int,
              linkStyle: "STANDALONE",
              link: a!dynamicLink(
                label: fv!row.pastdueOver30Days_int,
                value: fv!row.pastdueOver30Days_int,
                saveInto: {
                  a!save(
                    ri!selectedItemType_txt,
                    "Past Due in 30+ days"
                  ),
                  a!save(
                    ri!selectedItemReportType_txt,
                    fv!row.reportName_txt
                  )
                },
                showWhen: and(
                  not(
                    isnull(
                      tointeger(
                        fv!row.pastdueOver30Days_int
                      )
                    )
                  ),
                  tointeger(
                    fv!row.pastdueOver30Days_int
                  ) <> 0
                )
              )
            )
          )
        )
      }
    )

    I need to do same summary report at cust level(view is created at unique cust level and taking care of the counts that is mentioned in the code).How will I modify the code at unique cust level and on click of counts the new grid (grid is different based on some conditions)has to be display. can anyone help on this?

  • 0
    Certified Lead Developer
    in reply to sid

    I think you can use your condition based on your selectedItemType_txt variable. Please use apply when functionality into query filters of querylogicalexpression.

    a!localVariables(
      local!data: a!queryEntity(
        entity: cons!CDU_TRACK_ITEMS_DSE,
        query: a!query(
          pagingInfo: a!pagingInfo(1, - 1),
          logicalExpression: a!queryLogicalExpression(
            operator: "AND",
            filters: {
              a!queryFilter(
                field: "id",
                operator: "=",
                value: 1,
                applyWhen: ri!selectedItemType_txt = "1"
              ),
              a!queryFilter(
                field: "id",
                operator: "=",
                value: 2,
                applyWhen: ri!selectedItemType_txt = "2"
              ),
              a!queryFilter(
                field: "id",
                operator: "=",
                value: 3,
                applyWhen: ri!selectedItemType_txt = "3"
              ),
              a!queryFilter(
                field: "id",
                operator: "=",
                value: 4,
                applyWhen: ri!selectedItemType_txt = "4"
              )
            }
          )
        )
      ).data,
      local!data
    )

    In the above code, i fetch the data based on the variable. 

  • Hi yes  I have used the same query rule and but my requirement is to get the same grid at cust level in that how would I modify the above shared code ? and on click of dynamic link counts as i said need to display the other grid which data is coming from the other view.