Skip to main content
June 7, 2023
Solved

Display data from database view into interface

  • June 7, 2023
  • 9 replies
  • 0 views

Hi Team,

How do we display the database view data in the interface. What all related components do we need to create, like to retrieve data from table we create datatype and expression rule etc?

    Best answer by harshitb6843

    Every CDT-mapped table/view has to have a primary key column or a unique column that can be treated as a primary key column. You need to alter the view definition to include a new incremental int column that you'll treat as a PK column. 

    9 replies

    konduruc733182
    June 7, 2023

    Hello purvajab0002,

    You will need a CDT, Expression rule that queries your data and an Interface. If you just want to display your data with no particular UI requirements, you can use a read only grid. You can use records as well but there might be a sync issue since you will be using view. 

    June 7, 2023

    Thank you, that CDT should be add it to the data store?

    How do we mention the entity in the expression rule?

    harshitb6843
    June 7, 2023

    Add it to the DataStore, and create a constant that points to the newly added DSE. Create an expression rule and use a!queryEntity() function to query the data and finally use the ER in an interface to show the data in a grid.