View this page in the latest version of Appian. a!leftb() Function Share Share via LinkedIn Reddit Email Copy Link Print On This Page Returns a specified number of bytes from the text, starting from the first byte. Parameters a!leftb( text, num_bytes, encoding ) Keyword Type Description text Text The text from which the substring will be taken. num_bytes Number The length in bytes of the subtext to extract. encoding Text The character encoding to use when counting bytes. The value must be a valid Preferred MIME Name from the IANA character sets registry. For example, UTF-8, Shift_JIS, or GBK. Default: UTF-8. Returns Text Using the function The following sections cover important details about the a!leftb() function. Using the encoding parameter The a!leftb() function counts bytes using the encoding specified in the encoding parameter. When working with multi-byte character sets such as UTF-8 or Shift_JIS, characters can occupy more than one byte. Specifying the correct encoding ensures the function extracts the expected substring without splitting a multi-byte character. The encoding value must be a valid Preferred MIME Name from the IANA character sets registry. If omitted, the function uses UTF-8. Examples The following examples demonstrate the a!leftb() function. To experiment with examples, copy and paste the expression into an expression rule and click TEST RULE to see the output. a!leftb("boston",3) returns bos a!leftb("日本語", 4, "Shift_JIS") returns 日本 Feature compatibility The table below lists this function's compatibility with various features in Appian. Feature Compatibility Note Portals Compatible Offline Interfaces Compatible Sync-Time Custom Record Fields Compatible Can be used to create a custom record field that only evaluates at sync time. Real-Time Custom Record Fields Incompatible Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. Process Reports Compatible Process Events Compatible Can be used to configure a process event node, such as a start event or timer event. Process Autoscaling Compatible Can be used in autoscaled processes. Event Consumer Filter Conditions Compatible Can be used in filter conditions. Event Consumer Event Handlers Compatible Can be used in event handler expressions. Old versions There are older versions of this function . You can identify older versions by looking at the name to see if there is a version suffix. If you are using an old version, be sure to refer to the corresponding documentation from the list below. Old Versions Reason for Update leftb_26r8 Added an encoding parameter to support multi-byte character encodings. For more on what's changed, see New version details. To use the latest version of the function, replace the function with a version suffix with a new function reference. To learn more about how Appian handles this kind of versioning, see the Function and Component Versions page. Feedback Was this page helpful? SHARE FEEDBACK Loading...