Skip to main content
October 2, 2023
Question

Display label not index in a grid

  • October 2, 2023
  • 2 replies
  • 0 views

How can display the label of the choice and not the index in the grid . The data is being fetched form lookup table ( RECORD type),while the document table is a CDT.  

       example on how i display the dropdowns
       
         a!dropdownField(
                label: "Main Type",
                labelPosition: "ABOVE",
                placeholder: "--- Select a Value ---",
                choiceLabels:local!type['recordType!{myrecord} Main Type.fields.{myrecord}descEn'],
                choiceValues: local!type['recordType!{myrecord} Main Type.fields.{myrecord}itemCode'],
                value:ri!DocDetails.mainType,
                saveInto: {ri!DocDetails.mainType},
              
                searchDisplay: "AUTO",
                required: true,
                validations: {}
              )

 a!textField(
                  value:fv!item.id,
                  saveInto:fv!item.id,
                  readOnly: true,
                  align: "CENTER"
                ),

                a!textField(
                  value: fv!item.docForm,
                  saveInto:  fv!item.docForm,
                  readOnly: true,
                  align: "CENTER"
                ),

                a!textField(
                  value:fv!item.mainType,
                  saveInto:  fv!item.mainType,
                  readOnly: true,
                  align: "CENTER"
                ),

2 replies

stefanhelzle0001
Brainy
October 2, 2023

I am not sure I fully understand your ask, but to display the labels from a lookup table, you can easily query related record data.

docs.appian.com/.../fnc_system_queryrecordtype.html

abhishekt1213
October 4, 2023

Hi there, I'm not sure if I have got Your problem correctly or not. If you are saying you want to fetch the data (like Apple, Ball,..) instead of index (like 1,2,3,..) in the grid you can simply use the if condition like this

if(recordType!Customer.fields.Document = 1, "New Doc", if(recordType!Customer.fields.Document = 2, "Old Doc", "")