Skip to main content
Known Participant
Oct 2, 2023 12:17 PM UTC
Question

Display label not index in a grid

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
Oct 2, 2023 12:32 PM UTC

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
New Participant
Oct 4, 2023 1:18 PM UTC

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", "")