English
Fx.global
About 395 wordsAbout 1 min
2026-01-09
Summary
The overview of this document is as follows: This document introduces the API definitions of Fx.globalvariable, usage methods, and related notes.
1. findByApiName Retrieve global variable value
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
}
//dosomethingChangelog
| Version | Date | Changes | Author |
|---|---|---|---|
| v1.0 | 2026-05-20 | Initial version |
Background
This document provides detailed information about the Fx.global API functionality and usage, helping developers integrate relevant capabilities.
Applicable Scenarios
Specific applicable scenarios are determined by actual business needs. Developers can select the appropriate API for integration as required.
Prerequisites
- Access to Fxiaoke Open Platform
- Application authorization and configuration completed
- Basic knowledge of relevant business domain
Steps
Please refer to the detailed instructions for each API.
Notes
- Ensure prerequisites are met before calling APIs
- Pay attention to API call frequency limits
- Refer to error code documentation for exception handling
Compatibility note: This version currently has no deprecated or compatibility notes.
