Getting Data into editable grid

Hi,

I have written the following code where sampleData is a DataStore entity, but I am not getting any data in the front end:

rows: a!forEach( items: ri!sampleData,
expression: a!gridRowLayout(
contents: {
a!textField(
value: ri!sampleData.Account,
saveInto: fv!item.Account,
readOnly: true
),
a!textField(
value: fv!item.jan,
saveInto: fv!item.jan
),
a!textField(
value: fv!item.feb,
saveInto: fv!item.feb
),
a!textField(
value: fv!item.mar,
saveInto: fv!item.mar
)
}
)
),

But when I open the front end I see the following table:

What should I do so that the front end shows the data?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • I want to extract the data from the database in an editable grid so that I add data or update the existing data.

    Steps taken for this:

    1. Created a DataType, which corresponds to the target table in the database

    2. Added DataType in DataStore

    3. Created a constant of the DataType

    4. In the interface created a rule input (sampleData) which is DataStore

    5. Create an editable grid which shows the data (Stuck Here)  

    Experiments:

    1. Try to create expression rule name (Add_budget)

    2. Try creating a process model

    Hopefully this helps

  • 0
    Appian Employee
    in reply to Karanc

    Karan, you're trying to edit items from a "DataType" type. Taking that into consideration, your interface's rule input should be of the "DataType" type and not and not a Data Store Entity. See more of these concepts in the following link (https://docs.appian.com/suite/help/20.3/Data_Stores.html)

    Once you have the CDT that you created as the type of your rule input, you will need to test that your interface is working, i.e:

    1. Receives a list of your DataType (you can use a queryEntity on your test)
    2. After updates on the grid, your rule input contains the updated values (check the rule inputs section of your interface designer).

    Once you do that, you're set for success and just need to figure out the where you will use that interface. You can use by itself or with a process model. Both approaches allow to write to the data store entity (docs.appian.com/.../Write_to_Data_Store_Entity_Smart_Service.html)