English
Fx.global
About 259 wordsLess than 1 minute
2026-01-09
1. findByApiName Retrieve global variable value
Find global variable values
Fx.global.findByApiName(<String apiName>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| apiName | String | Global variable ApiName | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| error | Boolean | Indicates whether an error occurred |
| data | String | Returned data |
| message | String | Message |
Return an example
{
"error": false,
"data": "Global variable value"
},
"message": ""
}Code examples
def (Boolean error, Object result, String errorMessage) = Fx.global.findByApiName("var_zx9ua__g")
if (error) {
log.error("Failed to retrieve object: " + errorMessage)
//1. Terminate execution by throwing exception
//Fx.message.throwException("Failed to retrieve object: " + errorMessage)
//2. Terminate execution using return
//return;
//3. Continue execution
}
//dosomething2. findByApiName Retrieve global variable values with multilingual support
Find global variable values with multi-language support
Fx.global.findByApiName(<String apiName>, <String lang>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| apiName | String | Global variable ApiName | Y |
| lang | String | Language locale. Simplified Chinese "zh-CN", Traditional Chinese "zh-TW", English "en" | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| error | Boolean | Indicates whether an error occurred |
| data | String | Returned data |
| message | String | Message information |
Return an example
{
"error": false,
"data": "{\"success\":true,\"global_Variable\":{\"tenant_id\":\"74255\",\"last_modified_time\":1682497463935,\"create_time\":1682497463935,\"label\":\"Function Test Global Variable\",\"type\":\"text\",\"is_deleted\":false,\"api_name\":\"var_x685s__g\",\"define_type\":\"custom\",\"_id\":\"6448dfb7bacd61000120bf81\",\"value\":\"Function Test English\",\"remarks\":\"\"}}",
"message": ""
}Code examples
def (Boolean error, String result, String errorMessage) = Fx.global.findByApiName("var_zx9ua__g", "zh_CN")
if (error) {
log.error("Failed to retrieve object: " + errorMessage)
//1. Terminate execution with error
//Fx.message.throwException("Failed to retrieve object: "+errorMessage)
//2. Terminate execution using return
//return;
//3. Continue execution
}
//dosomething