How to read text from the Text table

Learn how to query and filter text values from the Text table for various fields, including payment and delivery methods, using GraphQL.

Overview

The Text table contains text values for various fields from many tables. Examples are the text values for the payment method and delivery method of an order. It is a common need to retrieve these texts. The following image shows possible values for the payment method for an order:

Payment methods

These values can be retrieved with a query as follows:

Query
query read_payment_methods($cid :Int!)
{
  useCompany(no :$cid)
  {
    text(filter:{_and : [
      {textType : {_eq : 7}},
      {languageNo : {_eq : 47}}
    ]})
    {
      totalCount
      items
      {
        textNo
        text
      }
    }
  }
}
Result
{
  "data": {
    "useCompany": {
      "text": {
        "totalCount": 10,
        "items": [
          {
            "textNo": 1,
            "text": "Kontant kasse"
          },
          {
            "textNo": 2,
            "text": "Bankkort"
          },
          {
            "textNo": 3,
            "text": "Visa"
          },
          {
            "textNo": 4,
            "text": "Master-/Eurocard"
          },
          {
            "textNo": 5,
            "text": "Am-ex"
          },
          {
            "textNo": 8,
            "text": "Tilgodelapp"
          },
          {
            "textNo": 9,
            "text": "Gavekort"
          },
          {
            "textNo": 97,
            "text": "Diverse"
          },
          {
            "textNo": 98,
            "text": "Differanse dagsoppgjør"
          },
          {
            "textNo": 99,
            "text": "Avbrutt"
          }
        ]
      }
    }
  }
}

Filtering

These text values are available in multiple languages. Therefore, you need to filter by language and text type, as shown in the previous example.

The possible values for languages are the following:

LanguageNoLanguage
44English
45Danish
46Swedish
47Norwegian

The possible values for the texttype field are presented in the following table:

Text typeDescription (Identifier)
1FreeText
2ReminderText
3DocumentName
4DeliveryTerms
5DeliveryMethod
6PaymentTerms
7PaymentMethod
8InformationCategory
9District
10Trade
11OrderPriceGroup
12CustomerPriceGroup1
13ProductPriceGroup1
14EmployeePriceGroup
15PayrollRateNo
16Unit
17TaxAndAccountingGroup
18AccountSet
19ProductType1
20TransactionGroup1
21ProductPriceGroup2
22BudgetLineType
23StockCountGroup
24AssociateGrouping1
25AssociateGrouping2
26AssociateGrouping3
27AssociateGrouping4
28AssociateGrouping5
29AssociateGrouping6
30GeneralLedgerAccountGrouping1
31GeneralLedgerAccountGrouping2
32GeneralLedgerAccountGrouping3
33GeneralLedgerAccountGrouping4
34GeneralLedgerAccountGrouping5
35GeneralLedgerAccountGrouping6
36OrgUnitGrouping1
37OrgUnitGrouping2
38OrgUnitGrouping3
39OrgUnitGrouping4
40OrgUnitGrouping5
41OrgUnitGrouping6
42ProductGrouping1
43ProductGrouping2
44ProductGrouping3
45ProductGrouping4
46ProductGrouping5
47ProductGrouping6
48OrderGrouping1
49OrderGrouping2
50OrderGrouping3
51OrderGrouping4
52OrderGrouping5
53OrderGrouping6
54ProductTransactionControlStatus
55AccountingTransactionControlStatus
56ReportHeading
57SumLine
58ProductType2
59TransactionGroup2
60OrgUnitStatus
61CapitalAssetGrouping1
62CapitalAssetGrouping2
63CapitalAssetGrouping3
64CapitalAssetGrouping4
65CapitalAssetGrouping5
66CapitalAssetGrouping6
67PaymentPriority
68DeliveryPriority
69AppointmentPriority
70DayPriority
71DocumentGroup
72ProductPriceGroup3
73CustomerPriceGroup2
74AssociateGrouping7
75AssociateGrouping8
76AssociateGrouping9
77AssociateGrouping10
78AssociateGrouping11
79AssociateGrouping12
80GeneralLedgerAccountGrouping7
81GeneralLedgerAccountGrouping8
82GeneralLedgerAccountGrouping9
83GeneralLedgerAccountGrouping10
84GeneralLedgerAccountGrouping11
85GeneralLedgerAccountGrouping12
86CapitalAssetGrouping7
87CapitalAssetGrouping8
88CapitalAssetGrouping9
89CapitalAssetGrouping10
90CapitalAssetGrouping11
91CapitalAssetGrouping12
92OrgUnitGrouping7
93OrgUnitGrouping8
94OrgUnitGrouping9
95OrgUnitGrouping10
96OrgUnitGrouping11
97OrgUnitGrouping12
98ProductGrouping7
99ProductGrouping8
100ProductGrouping9
101ProductGrouping10
102ProductGrouping11
103ProductGrouping12
104OrderGrouping7
105OrderGrouping8
106OrderGrouping9
107OrderGrouping10
108OrderGrouping11
109OrderGrouping12
110TransactionGroup3
111TransactionGroup4
112ProductType3
113ProductType4
114AppointmentGrouping1
115AppointmentGrouping2
116AppointmentGrouping3
117AppointmentGrouping4
118AppointmentGrouping5
119AppointmentGrouping6
120AppointmentGrouping7
121AppointmentGrouping8
122AppointmentGrouping9
123AppointmentGrouping10
124AppointmentGrouping11
125AppointmentGrouping12
126PriceType
127CreateDocument
128CrmTexts
129EftCurrencyCode
130EftTaxCode
131EftDeclarationCode
132EftPaymentMethod
133PriceRefundGrouping1
134PriceRefundGrouping2
135EuGoodsStatisticsNo
137AssociateInformationGroup1
138AssociateInformationGroup2
139AssociateInformationGroup3
140AssociateInformationGroup4
141AssociateInformationGroup5
142AssociateInformationGroup6
143AssociateInformationGroup7
144AssociateInformationGroup8
145ProductCategory
146CustomerPriceGroup3
147ProxyType
148RoleType
149MessageType
150ExternalConfigurationGrouping1
151ExternalConfigurationGrouping2
152ExternalConfigurationGrouping3
153ExternalConfigurationGrouping4
154InterestRateGroup
155SmsProvider
156FreeInformationType1
157FreeInformationGrouping1
158FreeInformationGrouping2
159FreeInformationGrouping3
160FreeInformationGrouping4
161ShipmentGrouping1
162ShipmentGrouping2
163VoucherGroup1
164VoucherGroup2
165VoucherTypeText
166AlternativeProductGrouping1
167AlternativeProductGrouping2
168StructureGrouping1
169StructureGrouping2
170StructureGrouping3
171StructureGrouping4
172StructureGrouping5
173StructureGrouping6
174StructureGrouping7
175StructureGrouping8
176StructureGrouping9
177StructureGrouping10
178StructureGrouping11
179StructureGrouping12
180FreeInformationCategory
181ExternalExportGrouping
182TimeScheduleBalanceGroup
183TaxTerm
184BankFormat
185AppointmentDescription
186RemittanceCodeForRemittanceAgreements
187RegistrationTypeForPaymentAgreements
188CommentCodeForPaymentAgreements
189FreeInformation1Type2
190FreeInformation1Type3
191FreeInformation2Type2
192FreeInformation2Type3
193FreeInformation3Type2
194FreeInformation3Type3
195FreeInformationGrouping5
196FreeInformationGrouping6
197FreeInformationGrouping7
198FreeInformationGrouping8
199FreeInformationGrouping9
200FreeInformationGrouping10
201FreeInformationGrouping11
202FreeInformationGrouping12
203EftFormType
204DeliveryAlternativeGrouping1
205DeliveryAlternativeGrouping2
206GiroType
207OssTaxTerm
208EmailTemplateGroup
211ExemptReason
212InvoiceNote

Joining values from the text table

The values from the Text table are usually needed when reading records from other tables. An example was previously given: reading the payment method and the delivery method of an order. A direct joining mechanism is not available in the API (such as a joinup_ \ joindown_ relation). However, it is possible to read them in a single query with the help of the @export directive.

The following example shows how to read the payment and delivery method of a particular order:

Query
query read_texts($cid : Int!,
                 $orderNo : Int,
                 $dm : Long = 0,
                 $pm : Long  = 0)
{
  useCompany(no : $cid)
  {
    order(filter :{orderNo :{_eq : $orderNo}})
    {
      items
      {
        orderNo
        deliveryMethod @export(as :"dm")
        paymentMethod @export(as : "pm")
      }
    }

    deliveryMethodName : text(filter: {
      languageNo :{_eq : 47} # Norwegian
      textType : {_eq : 5}   # delivery method
      textNo : {_eq : $dm}
    })
    {
      items
      {
        text
      }
    }

    paymentMethodName : text(filter: {
      languageNo :{_eq : 47} # Norwegian
      textType : {_eq : 7}   # payment method
      textNo : {_eq : $pm}
    })
    {
      items
      {
        text
      }
    }
  }
}
Result
{
  "data": {
    "useCompany": {
      "order": {
        "items": [
          {
            "orderNo": 1,
            "deliveryMethod": 4,
            "paymentMethod": 3
          }
        ]
      },
      "deliveryMethodName": {
        "items": [
          {
            "text": "Tollpost"
          }
        ]
      },
      "paymentMethodName": {
        "items": [
          {
            "text": "Visa"
          }
        ]
      }
    }
  }
}

What you have to do is the following:

  • read the numerical value of the text type you want to retrieve (such as paymentMethod and deliveryMethod in this example)
  • export this numerical value to a query variable using the @export directive
  • make another read, this time from the Text table, and filter using the desired language, the appropriate text type (such as 5 for DeliveryMethod and 7 for PaymentMethod), and the text number stored in the (previously read) query variable
  • you can make as many reads as you want from the Text table in a single query, provided you diferentiate them using aliases
Last modified April 15, 2025