このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Referencing Functions

Updated on 2024-07-17 GMT+08:00

You can reference functions to quickly configure connectors when editing and designing a composite application.

Figure 1 describes how to use functions in composite applications.

Figure 1 Referencing functions

Category

Math, string, encryption and decryption, date and time, encoding and decoding, and number system conversion.

Table 1 Functions

Category

Function

Description

Math (2)

sum(array arr)

Returns the sum of all numbers in an array.

avg(array arr)

Returns the average of all numbers in an array.

String (29)

uuid()

Generates a random UUID consisting of letters and digits.

upper(string str)

Converts a string into uppercase letters.

lower(string str)

Converts a string into lowercase letters.

camelize(string str)

Converts words in a string into the camel case format, deletes all spaces, and converts the first letter of each word except the first word into the uppercase format.

dasherize(string str)

Converts words in a string into the kebab case format, letters into lowercase letters, and all spaces into hyphens (-).

capitalize(string str)

Converts the first letter of each word into the uppercase format and the other letters into the lowercase format.

charCode(string char)

Converts characters to character encoding.

fromCharCode(number charCode)

Converts a character encoding into a string.

charCodeAt(string str, number index)

Returns the character encoding at the index in a string.

isAlpha(string str)

Returns a Boolean value that indicates whether a string contains only English letters.

isAlphanumeric(string str)

Returns a Boolean value that indicates whether a string contains only English letters or digits.

isNumeric(string str)

Returns a Boolean value that indicates whether a string contains only digits.

isLowerCase(string str)

Returns a Boolean value that indicates whether a string contains only lowercase letters.

isUpperCase(string str)

Returns a Boolean value that indicates whether a string contains only uppercase letters.

isWhitespace(string str)

Returns a Boolean value that indicates whether a string contains only spaces.

leftPad(string str, number offset)

If the string is shorter than the offset, pads the left side of the string with spaces.

rightPad(string str, number offset)

If the string is shorter than the offset, pads the right side of the string with spaces.

substringAfter(string str, string separator)

Gets the substring after the first separator.

substringAfterLast(string str, string separator)

Gets the substring after the last separator.

substringBefore(string str, string separator)

Gets the substring before the first separator.

substringBeforeLast(string str, string separator)

Gets the substring before the last separator.

unwrap(string str, string wrapper)

Returns a string without the wrapper text. The wrapper text is the value before and/or after a string.

withMaxSize(string str, number size)

Limits the size of a string.

wrapIfMissing(string str, string wrapper)

If a string is not wrapped, adds the wrapper at the beginning or end. If the wrapper already exists at the beginning or end, updates only the missing end.

wrapWith(string str, string wrapper)

Adds the wrapper at the beginning or end of a string.

ordinalize(number num)

Converts num to an ordered character string, for example, 1st, 2nd, or 3rd.

appendIfMissing(string str, string value)

If a string does not end with value, adds value there.

prependIfMissing(string str, string value)

If a string does not start with value, adds value there.

repeat(string str, number times)

Repeats the given number of times.

Encryption and decryption (4)

hash(string value, string algorithm)

Calculates the hash value using a supported algorithm. The algorithm must be MD2, MD5, SHA-1, SHA-256, SHA-384 or SHA-512.

hmac(string value, string secret, string algorithm)

Generates a hash-based authentication code using the provided value, key, and hash function algorithm. The algorithm must be HMACSHA1, HMACSHA256, or HMACSHA512.

encrypt(string value, string secret, string transformation)

Encrypts the value using the specified JDK and key, and converts the encryption into a readable format using Base64.

decrypt(string value, string secret, string algorithm, string mode, string padding)

Decrypts the Base64 value using the specified JDK and key.

Date and time (20)

now()

Returns the current date and time.

compare(string datetime1, string datetime2)

If datetime1 > datetime2, returns 1; if datetime1 < datetime2, returns -1; if datetime1 == datetime2, returns 0.

atBeginningOfDay(string datetime)

Returns the midnight time value of a given time.

atBeginningOfHour(string datetime)

Returns the given date and time, with minute and second as 0.

atBeginningOfMonth(string datetime)

Returns the first day of the month, with time as midnight.

atBeginningOfWeek(string datetime)

Returns the first day of the current week, with time as midnight.

atBeginningOfYear(string datetime)

Returns the first day of the year, with time as midnight.

changeTimeZone(string datetime, string timezone)

Changes the time zone, which usually results in a change in the local date and time.

daysBetween(string datetime1, string datetime2)

Returns the number of days between datetime1 and datetime2.

format(string datetime, string outputFormat)

Converts a given datetime into the specified format.

isLeapYear(string datetime)

Returns a Boolean value indicating whether datetime is a leap year.

plus(string datetime, string period)

Adds a date to a datetime.

minus(string datetime, string period)

Subtracts a date to a datetime.

parse(string|number datetime, string inputFormat)

Parses datetime using the input format and returns a value in the default format. If the epoch or timestamp value is used as the datetime, epoch or timestamp can be used as inputFormat.

toLocalDate(string datetime)

Localizes a date.

toLocalDateTime(string datetime)

Localizes a date and time.

toLocalTime(string datetime, string format)

Localizes a time.

today()

Returns the midnight time of the current day.

tomorrow()

Returns the midnight time of the next day.

yesterday()

Returns the midnight time of the previous day.

Encoding and decoding (2)

encode(string data, string encoding="UTF-8")

Converts a string to the application/x-www-form-urlencoded format using the provided encoding scheme to obtain insecure bytes. The default encoding is UTF-8.

decode(string data, string encoding="UTF-8")

Decodes the application/x-www-form-urlencoded string using a specific encoding scheme to determine which characters are represented by a continuous sequence in the form of %xy.

Number system conversion (9)

fromBase64(string value)

Converts a Base64 code to a value.

toBase64(any value)

Base64-encodes a value.

fromHex(string value)

Converts a hexadecimal number to a value.

toHex(any value)

Converts a value to a hexadecimal number.

fromBinary(number value)

Converts a value from binary to decimal.

fromHex(number value)

Converts a value from hexadecimal to decimal.

fromRadixNumber(number value, number baseAsBinary)

Converts a value to a decimal number.

toBinary(number value)

Converts a value from decimal to binary.

toRadixNumber(number value, number baseAsDecimal)

Converts a value to a specified number system.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback