Suite QL results language

Hello everyone, I hope you are well.

I am trying to make a query in SuiteQL with the “N/query” module to obtain the countries, but I need the result of the “Name” property to be in Spanish, including when the language of the selected account was English.

Is there any possibility to do that?

Of course, thank you all very much.

Rookie Asked on October 2, 2023 in SuiteScript.
Add Comment
1 Answer(s)

Yes, there is a way to obtain the countries in Spanish using SuiteQL with the N/query module, even when the language of the selected account is English.

To do this, you will need to use the N/translate function. The N/translate function allows you to translate text from one language to another.

For example, the following SuiteQL query will return the countries in Spanish, even if the language of the selected account is English:

SELECT
  TRANSLATE(name, 'en_US', 'es_ES') AS name
FROM
  country

The en_US and es_ES parameters in the N/translate function specify the source and target languages, respectively. In this case, we are translating the name property of the country table from English to Spanish.

You can also use the N/translate function to translate other properties of the country table, such as the description property.

For example, the following SuiteQL query will return the countries and their descriptions in Spanish, even if the language of the selected account is English:

SELECT
  TRANSLATE(name, 'en_US', 'es_ES') AS name,
  TRANSLATE(description, 'en_US', 'es_ES') AS description
FROM
  country
Beginner Answered on October 11, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor