CINXE.COM

Adaptive expressions prebuilt functions in Bot Framework SDK - Bot Service | Microsoft Learn

<!DOCTYPE html><html class="hasSidebar hasPageActions hasBreadcrumb conceptual has-default-focus theme-light" lang="en-us" dir="ltr" data-authenticated="false" data-auth-status-determined="false" data-target="docs" x-ms-format-detection="none"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta property="og:title" content="Adaptive expressions prebuilt functions in Bot Framework SDK - Bot Service" /> <meta property="og:type" content="website" /> <meta property="og:url" content="https://learn.microsoft.com/en-us/azure/bot-service/adaptive-expressions/adaptive-expressions-prebuilt-functions?view=azure-bot-service-4.0" /><meta property="og:description" content="Learn about the available prebuilt functions in adaptive expressions ordered by their general purpose." /><meta property="og:image" content="https://learn.microsoft.com/en-us/media/open-graph-image.png" /> <meta property="og:image:alt" content="Microsoft Learn" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:site" content="@MicrosoftLearn" /> <meta name="color-scheme" content="light dark"><meta name="archive_url" content="https://docs.microsoft.com/previous-versions/azure/bot-service/index-bf-sdk" /> <meta name="author" content="JonathanFingold" /> <meta name="breadcrumb_path" content="/azure/bot-service/breadcrumb/TOC.json" /> <meta name="default_moniker" content="azure-bot-service-4.0" /> <meta name="depot_name" content="Azure.bot-framework" /> <meta name="description" content="Learn about the available prebuilt functions in adaptive expressions ordered by their general purpose." /> <meta name="document_id" content="f5cc1453-1ec4-1ad7-2a9f-fa934224b79d" /> <meta name="document_version_independent_id" content="9645f547-d38a-4a22-c84b-ee98b7f24dfc" /> <meta name="exclude_monikers" content="azure-bot-service-3.0" /> <meta name="feedback_help_link_type" content="" /> <meta name="feedback_help_link_url" content="" /> <meta name="feedback_product_url" content="" /> <meta name="feedback_system" content="None" /> <meta name="git_commit_id" content="74b6632248c0a95e4a63a652a8b6f4bf3a1f0e7f" /> <meta name="gitcommit" content="https://github.com/MicrosoftDocs/bot-docs-pr/blob/74b6632248c0a95e4a63a652a8b6f4bf3a1f0e7f/articles/adaptive-expressions/adaptive-expressions-prebuilt-functions.md" /> <meta name="keywords" content="adaptive expressions, prebuilt functions, reference" /> <meta name="locale" content="en-us" /> <meta name="manager" content="shellyha" /> <meta name="monikerRange" content="azure-bot-service-4.0" /> <meta name="monikers" content="azure-bot-service-4.0" /> <meta name="ms.author" content="iawilt" /> <meta name="ms.custom" content="evergreen" /> <meta name="ms.date" content="09/22/2021" /> <meta name="ms.reviewer" content="micchow" /> <meta name="ms.service" content="azure-ai-bot-service" /> <meta name="ms.topic" content="reference" /> <meta name="original_content_git_url" content="https://github.com/MicrosoftDocs/bot-docs-pr/blob/live/articles/adaptive-expressions/adaptive-expressions-prebuilt-functions.md" /> <meta name="page_type" content="conceptual" /> <meta name="pdf_url_template" content="https://learn.microsoft.com/pdfstore/en-us/Azure.bot-framework/{branchName}{pdfName}" /> <meta name="schema" content="Conceptual" /> <meta name="site_name" content="Docs" /> <meta name="toc_rel" content="../toc.json" /> <meta name="uhfHeaderId" content="azure" /> <meta name="updated_at" content="2024-08-02 01:02 PM" /> <meta name="word_count" content="18341" /> <meta name="persistent_id" content="82ff608f-da69-1f84-c7f4-a32ba538d336" /> <meta name="cmProducts" content="https://authoring-docs-microsoft.poolparty.biz/devrel/8b896464-3b7d-4e1f-84b0-9bb45aeb5f64" data-source="generated" /> <meta name="cmProducts" content="https://authoring-docs-microsoft.poolparty.biz/devrel/540ac133-a371-4dbb-8f94-28d6cc77a70b" data-source="generated" /> <meta name="spProducts" content="https://authoring-docs-microsoft.poolparty.biz/devrel/b1d2d671-9549-46e8-918c-24349120dbf5" data-source="generated" /> <meta name="spProducts" content="https://authoring-docs-microsoft.poolparty.biz/devrel/60bfc045-f127-4841-9d00-ea35495a5800" data-source="generated" /> <meta name="scope" content="Azure, BotService" /><meta name="github_feedback_content_git_url" content="https://github.com/MicrosoftDocs/bot-docs-pr/blob/live/articles/adaptive-expressions/adaptive-expressions-prebuilt-functions.md" /><link href="https://learn.microsoft.com/en-us/azure/bot-service/adaptive-expressions/adaptive-expressions-prebuilt-functions?view=azure-bot-service-4.0" rel="canonical"><title>Adaptive expressions prebuilt functions in Bot Framework SDK - Bot Service | Microsoft Learn</title><link rel="stylesheet" href="/static/assets/0.4.028726178/styles/site-ltr.css"> <script id="msdocs-script"> var msDocs = {environment: { supportLevel: 'production', accessLevel: 'online', reviewFeatures: false, systemContent: true, azurePortalHostname: 'portal.azure.com', legacyHosting: false, siteName: 'learn', },data: { timeOrigin: Date.now(), contentLocale: 'en-us', contentDir: 'ltr', userLocale: 'en-us', userDir: 'ltr', pageTemplate: 'Conceptual', brand: 'azure', context: {}, hasBinaryRating: true, feedbackHelpLinkType:'', feedbackHelpLinkUrl:'', standardFeedback: false, showFeedbackReport: false, enableTutorialFeedback: false, feedbackSystem: 'None', feedbackGitHubRepo: '', feedbackProductUrl: '',extendBreadcrumb: false,isEditDisplayable: false, hideViewSource: false, hasPageActions: true, hasPrintButton: true, hasBookmark: true, hasShare: true, isPermissioned: false, isPrivateUnauthorized: false,hasRecommendations: true,contributors: [{ name: "JonathanFingold", url: "https://github.com/JonathanFingold" },{ name: "cyrilanderson", url: "https://github.com/cyrilanderson" },{ name: "Danieladu", url: "https://github.com/Danieladu" },{ name: "emgrol", url: "https://github.com/emgrol" },{ name: "tonyanziano", url: "https://github.com/tonyanziano" },{ name: "erhopf", url: "https://github.com/erhopf" },{ name: "Kaiqb", url: "https://github.com/Kaiqb" }],}, functions:{} }; </script><script src="https://wcpstatic.microsoft.com/mscc/lib/v2/wcp-consent.js"></script> <script src="https://js.monitor.azure.com/scripts/c/ms.jsll-4.min.js"></script><script src="/static/assets/0.4.028726178/global/deprecation.js"></script><script src="/static/assets/0.4.028726178/scripts/en-us/index-docs.js"></script></head> <body lang="en-us" dir="ltr"> <div class="header-holder has-default-focus"> <a href="#main" style="z-index: 1070" class="outline-color-text visually-hidden-until-focused position-fixed inner-focus focus-visible top-0 left-0 right-0 padding-xs text-align-center has-body-background" tabindex="1">Skip to main content</a><div hidden id="cookie-consent-holder" data-test-id="cookie-consent-container"></div> <div id="unsupported-browser" style=" background-color: white; color: black; padding: 16px; border-bottom: 1px solid grey;" hidden > <div style="max-width: 800px; margin: 0 auto;"> <p style="font-size: 24px">This browser is no longer supported.</p> <p style="font-size: 16px; margin-top: 16px;">Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.</p> <div style="margin-top: 12px;"> <a href="https://go.microsoft.com/fwlink/p/?LinkID=2092881 " style=" background-color: #0078d4; border: 1px solid #0078d4; color: white; padding: 6px 12px; border-radius: 2px; display: inline-block; ">Download Microsoft Edge</a> <a href="https://learn.microsoft.com/en-us/lifecycle/faq/internet-explorer-microsoft-edge" style=" background-color: white; padding: 6px 12px; border: 1px solid #505050; color: #171717; border-radius: 2px; display: inline-block; ">More info about Internet Explorer and Microsoft Edge</a> </div> </div> </div> <!-- liquid-tag banners global --> <!-- site header --> <header id="ms--site-header" data-test-id="site-header-wrapper" role="banner" itemscope="itemscope" itemtype="http://schema.org/Organization"> <div id="ms--mobile-nav" class="site-header display-none-tablet padding-inline-none gap-none" data-bi-name="mobile-header" data-test-id="mobile-header"></div> <div id="ms--primary-nav" class="site-header display-none display-flex-tablet" data-bi-name="L1-header" data-test-id="primary-header"></div> <div id="ms--secondary-nav" class="site-header display-none display-flex-tablet" data-bi-name="L2-header" data-test-id="secondary-header"></div> </header><div id="content-header" class="content-header uhf-container has-padding has-default-focus border-bottom-none" data-bi-name="content-header"> <div class="content-header-controls margin-xxs margin-inline-sm-tablet"> <button type="button" class="contents-button button button-sm margin-right-xxs" data-bi-name="contents-expand" aria-haspopup="true" data-contents-button> <span class="icon"><span class="docon docon-menu" aria-hidden="true"></span></span> <span class="contents-expand-title">Table of contents</span> </button> <button type="button" class="ap-collapse-behavior ap-expanded button button-sm" data-bi-name="ap-collapse" aria-controls="action-panel"> <span class="icon"><span class="docon docon-exit-mode" aria-hidden="true"></span></span> <span>Exit focus mode</span> </button> </div> </div><div id="disclaimer-holder" class="has-overflow-hidden has-default-focus"> <!-- liquid-tag banners sectional --> </div> </div> <div class="mainContainer uhf-container has-default-focus" data-bi-name="body"> <div class="columns has-large-gaps is-gapless-mobile "><div id="left-container" class="left-container is-hidden-mobile column is-one-third-tablet is-one-quarter-desktop"> <nav id="affixed-left-container" class="margin-top-sm-tablet position-sticky display-flex flex-direction-column" aria-label="Primary"></nav> </div><!-- .primary-holder --> <section class="primary-holder column is-two-thirds-tablet is-three-quarters-desktop"> <!--div.columns --> <div class="columns is-gapless-mobile has-large-gaps "><div id="main-column" class="column is-full is-8-desktop"> <main id="main" class="" role="main" data-bi-name="content" lang="en-us" dir="ltr"><!-- article-header --> <div id="article-header" class="background-color-body margin-top-sm-tablet margin-bottom-xs display-none-print"> <div class="display-flex align-items-center "><details id="article-header-breadcrumbs-overflow-popover" class="popover" data-for="article-header-breadcrumbs"> <summary class="button button-clear button-primary button-sm inner-focus" aria-label="All breadcrumbs"> <span class="icon"> <span class="docon docon-more"></span> </span> </summary> <div id="article-header-breadcrumbs-overflow" class="popover-content padding-none"> </div> </details> <bread-crumbs id="article-header-breadcrumbs" data-test-id="article-header-breadcrumbs" class="overflow-hidden flex-grow-1 margin-right-sm margin-right-md-tablet margin-right-lg-desktop margin-left-negative-xxs padding-left-xxs"></bread-crumbs><div id="article-header-page-actions" class="opacity-none margin-left-auto display-flex flex-wrap-no-wrap align-items-stretch"><a id="lang-link-tablet" class="button button-primary button-clear button-sm display-none display-inline-flex-tablet" title="Read in English" data-bi-name="language-toggle" data-read-in-link hidden> <span class="icon margin-none" aria-hidden="true" data-read-in-link-icon> <span class="docon docon-locale-globe"></span> </span> <span class="is-visually-hidden" data-read-in-link-text>Read in English</span> </a><button type="button" class="collection button button-clear button-sm button-primary display-none display-inline-flex-tablet" data-list-type="collection" data-bi-name="collection" title="Add to collection"> <span class="icon margin-none" aria-hidden="true"> <span class="docon docon-circle-addition"></span> </span> <span class="collection-status is-visually-hidden">Save</span> </button><a data-contenteditbtn class="button button-clear button-sm text-decoration-none button-primary display-none display-inline-flex-tablet" aria-label="Edit" title="Edit This Document" data-bi-name="edit" hidden href="https://github.com/MicrosoftDocs/bot-docs-pr/blob/live/articles/adaptive-expressions/adaptive-expressions-prebuilt-functions.md"> <span class="icon margin-none" aria-hidden="true"> <span class="docon docon-edit-outline"></span> </span> </a> <details class="popover popover-right" id="article-header-page-actions-overflow"> <summary class="justify-content-flex-start button button-clear button-sm button-primary" aria-label="More actions" title="More actions"> <span class="icon" aria-hidden="true"> <span class="docon docon-more-vertical"></span> </span> </summary> <div class="popover-content padding-xs"><button data-page-action-item="overflow-mobile" type="button" class="justify-content-flex-start button-block button-sm has-inner-focus button button-clear display-none-tablet" data-bi-name="contents-expand" data-contents-button data-popover-close> <span class="icon"> <span class="docon docon-editor-list-bullet" aria-hidden="true"></span> </span><span class="contents-expand-title">Table of contents</span></button><a id="lang-link-overflow" class="justify-content-flex-start button-sm has-inner-focus button button-clear button-block display-none-tablet" title="Read in English" data-bi-name="language-toggle" data-page-action-item="overflow-mobile" data-check-hidden="true" data-read-in-link hidden > <span class="icon" aria-hidden="true" data-read-in-link-icon> <span class="docon docon-locale-globe"></span> </span> <span data-read-in-link-text>Read in English</span> </a><button type="button" class="collection justify-content-flex-start button button-clear button-sm has-inner-focus button-block display-none-tablet" data-list-type="collection" data-bi-name="collection" title="Save" data-page-action-item="overflow-mobile" data-check-hidden="true" data-popover-close> <span class="icon" aria-hidden="true"> <span class="docon docon-circle-addition"></span> </span> <span class="collection-status">Save</span> </button> <button type="button" class="collection justify-content-flex-start button button-clear button-sm has-inner-focus button-block display-none-tablet" data-list-type="plan" data-bi-name="plan" title="Add to Plan" data-page-action-item="overflow-mobile" data-check-hidden="true" data-popover-close hidden> <span class="icon" aria-hidden="true"> <span class="docon docon-circle-addition"></span> </span> <span class="plan-status">Add to Plan</span> </button><a data-contenteditbtn class="button button-clear button-block button-sm has-inner-focus justify-content-flex-start text-decoration-none display-none-tablet" aria-label="Edit" title="Edit This Document" data-bi-name="edit" hidden href="https://github.com/MicrosoftDocs/bot-docs-pr/blob/live/articles/adaptive-expressions/adaptive-expressions-prebuilt-functions.md"> <span class="icon" aria-hidden="true"> <span class="docon docon-edit-outline"></span> </span> <span>Edit</span> </a><div aria-hidden="true" class="margin-none" data-page-action-item="overflow-all"></div> <hr class="display-none-tablet margin-bottom-xxs margin-top-xxs" /> <h4 class="font-size-sm padding-left-xxs">Share via</h4> <a class="button button-clear button-sm button-block has-inner-focus text-decoration-none justify-content-flex-start share-facebook" data-bi-name="facebook" data-page-action-item="overflow-all"> <span class="icon" aria-hidden="true"> <span class="docon docon-facebook-share font-size-md color-primary"></span> </span> <span class="margin-left-xxs">Facebook</span> </a> <a class="button button-clear button-sm has-inner-focus button-block text-decoration-none justify-content-flex-start share-twitter" data-bi-name="twitter" data-page-action-item="overflow-all"> <span class="icon" aria-hidden="true"> <span class="docon docon-xlogo-share font-size-xxs"></span> </span> <span class="margin-left-xxs">x.com</span> </a> <a class="button button-clear button-sm has-inner-focus button-block text-decoration-none justify-content-flex-start share-linkedin" data-bi-name="linkedin" data-page-action-item="overflow-all"> <span class="icon" aria-hidden="true"> <span class="docon docon-linked-in-logo font-size-sm color-primary"></span> </span> <span class="margin-left-xxs">LinkedIn</span> </a> <a class="button button-clear button-sm button-block has-inner-focus text-decoration-none justify-content-flex-start margin-bottom-xxs share-email" data-bi-name="email" data-page-action-item="overflow-all"> <span class="icon" aria-hidden="true"> <span class="docon docon-mail-message font-size-sm color-primary"></span> </span> <span class="margin-left-xxs">Email</span> </a><hr /> <button class="button button-block button-clear button-sm justify-content-flex-start has-inner-focus margin-top-xxs" title="Print" type="button" aria-label="Print" data-bi-name="print" data-page-action-item="overflow-all" data-popover-close data-print-page data-check-hidden="true"> <span class="icon" aria-hidden="true"> <span class="docon docon-print font-size-sm color-primary"></span> </span> <span class="margin-left-xxs">Print</span> </button> </div> </details> </div></div> </div> <!-- end article-header --><div> <button type="button" class="border contents-button button button-clear button-sm is-hidden-tablet has-inner-focus" data-bi-name="contents-expand" data-contents-button hidden> <span class="icon"> <span class="docon docon-editor-list-bullet" aria-hidden="true"></span> </span><span class="contents-expand-title">Table of contents</span></button> </div><!-- end mobile-contents button --> <div class="content "><h1 id="adaptive-expressions-prebuilt-functions">Adaptive expressions prebuilt functions</h1><div class="display-flex justify-content-space-between align-items-center flex-wrap-wrap page-metadata-container"> <div class="margin-right-xxs"> <ul class="metadata page-metadata" data-bi-name="page info" lang="en-us" dir="ltr"><li>Article</li><li class="visibility-hidden-visual-diff"><time class="is-invisible" data-article-date aria-label="Article review date" datetime="2022-11-04T01:01:00Z" data-article-date-source="calculated">11/04/2022</time> </li><li class="contributors-holder display-none-print"> <button aria-label="View all contributors" class="contributors-button link-button" data-bi-name="contributors" title="View all contributors">7 contributors</button> </li></ul> </div> <div id="user-feedback" class="margin-block-xxs display-none-print" data-hide-on-archived> <button id="user-feedback-button" data-test-id="conceptual-feedback-button" class="button button-sm button-clear button-primary" type="button" data-bi-name="user-feedback-button" data-user-feedback-button > <span class="icon" aria-hidden="true"> <span class="docon docon-like"></span> </span> <span>Feedback</span> </button> </div></div><nav id="center-doc-outline" class="doc-outline is-hidden-desktop display-none-print margin-bottom-sm" data-bi-name="intopic toc" aria-label="In this article"> <h2 id="ms--in-this-article" class="title is-6 margin-block-xs">In this article</h2> </nav><!-- <content> --><p><strong>APPLIES TO:</strong> SDK v4</p> <p>This article lists the available prebuilt functions ordered by their general purpose. For information about operators used in prebuilt functions and expression syntax, see <a href="../bot-builder-concept-adaptive-expressions?view=azure-bot-service-4.0#operators" data-linktype="relative-path">Operators</a>.</p> <p>Prebuilt expressions are divided into the following function types:</p> <ul> <li><a href="#string-functions" data-linktype="self-bookmark">String</a></li> <li><a href="#collection-functions" data-linktype="self-bookmark">Collection</a></li> <li><a href="#logical-comparison-functions" data-linktype="self-bookmark">Logical comparison</a></li> <li><a href="#conversion-functions" data-linktype="self-bookmark">Conversion</a></li> <li><a href="#math-functions" data-linktype="self-bookmark">Math</a></li> <li><a href="#date-and-time-functions" data-linktype="self-bookmark">Date</a></li> <li><a href="#timex-functions" data-linktype="self-bookmark">Timex</a></li> <li><a href="#uri-parsing-functions" data-linktype="self-bookmark">URI parsing</a></li> <li><a href="#object-manipulation-and-construction-functions" data-linktype="self-bookmark">Object manipulation and construction</a></li> <li><a href="#regular-expression-functions" data-linktype="self-bookmark">Regular expression</a></li> <li><a href="#type-checking-functions" data-linktype="self-bookmark">Type checking</a></li> </ul> <p>You can also view the list in <a href="#prebuilt-functions-sorted-alphabetically" data-linktype="self-bookmark">alphabetical order</a>.</p> <h2 id="string-functions">String functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#length" data-linktype="self-bookmark">length</a></td> <td>Return the length of a string.</td> </tr> <tr> <td><a href="#replace" data-linktype="self-bookmark">replace</a></td> <td>Replace a substring with the specified string and return the updated string. This function is case-sensitive.</td> </tr> <tr> <td><a href="#replaceIgnoreCase" data-linktype="self-bookmark">replaceIgnoreCase</a></td> <td>Replace a substring with the specified string, and return the updated string. This function is case-insensitive.</td> </tr> <tr> <td><a href="#split" data-linktype="self-bookmark">split</a></td> <td>Return an array that contains substrings based on the delimiter specified.</td> </tr> <tr> <td><a href="#substring" data-linktype="self-bookmark">substring</a></td> <td>Return characters from a string.</td> </tr> <tr> <td><a href="#toLower" data-linktype="self-bookmark">toLower</a></td> <td>Return a string in lowercase in an optional locale format.</td> </tr> <tr> <td><a href="#toUpper" data-linktype="self-bookmark">toUpper</a></td> <td>Return a string in uppercase in an optional locale format.</td> </tr> <tr> <td><a href="#trim" data-linktype="self-bookmark">trim</a></td> <td>Remove leading and trailing white spaces from a string.</td> </tr> <tr> <td><a href="#addOrdinal" data-linktype="self-bookmark">addOrdinal</a></td> <td>Return the ordinal number of the input number.</td> </tr> <tr> <td><a href="#endsWith" data-linktype="self-bookmark">endsWith</a></td> <td>Check whether a string ends with a specific substring. Return <code>true</code> if the substring is found, or return <code>false</code> if not found. This function is case-insensitive.</td> </tr> <tr> <td><a href="#startsWith" data-linktype="self-bookmark">startsWith</a></td> <td>Check whether a string starts with a specific substring. Return <code>true</code> if the substring is found, or return <code>false</code> if not found. This function is case-insensitive.</td> </tr> <tr> <td><a href="#countWord" data-linktype="self-bookmark">countWord</a></td> <td>Return the number of words in the given string.</td> </tr> <tr> <td><a href="#concat" data-linktype="self-bookmark">concat</a></td> <td>Combine two or more strings and return the resulting string.</td> </tr> <tr> <td><a href="#newGuid" data-linktype="self-bookmark">newGuid</a></td> <td>Return a new Guid string.</td> </tr> <tr> <td><a href="#indexOf" data-linktype="self-bookmark">indexOf</a></td> <td>Return the starting position or index value of a substring <strong>or</strong> searches for the specified object and return the zero-based index of the first occurrence within the entire list. This function is case-insensitive, and indexes start with the number 0.</td> </tr> <tr> <td><a href="#lastIndexOf" data-linktype="self-bookmark">lastIndexOf</a></td> <td>Return the starting position or index value of the last occurrence of a substring <strong>or</strong> search for the specified object and return the zero-based index of the last occurrence within the range of elements in the list.This function is case-insensitive, and indexes start with the number 0.</td> </tr> <tr> <td><a href="#sentenceCase" data-linktype="self-bookmark">sentenceCase</a></td> <td>Capitalize the first letter of the first word in a string in an optional local format.</td> </tr> <tr> <td><a href="#titleCase" data-linktype="self-bookmark">titleCase</a></td> <td>Capitalize the first letter of each word in a string in an optional locale format.</td> </tr> <tr> <td><a href="#reverse" data-linktype="self-bookmark">reverse</a></td> <td>Reverse the order of the elements in a string or array.</td> </tr> </tbody> </table> <h2 id="collection-functions">Collection functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#contains" data-linktype="self-bookmark">contains</a></td> <td>Works to find an item in a string, to find an item in an array, or to find a parameter in a complex object. <br> <strong>Examples</strong>: <br> contains('hello world', 'hello')<br> contains(createArray('1','2'), '1')<br> contains(json("{'foo':'bar'}"), 'foo')</td> </tr> <tr> <td><a href="#first" data-linktype="self-bookmark">first</a></td> <td>Return the first item from the collection.</td> </tr> <tr> <td><a href="#join" data-linktype="self-bookmark">join</a></td> <td>Return a string that has all the items from an array and has each character separated by a delimiter.<br><strong>Example</strong>: <br> join(createArray('a','b'), '.') = "a.b"</td> </tr> <tr> <td><a href="#last" data-linktype="self-bookmark">last</a></td> <td>Return the last item from the collection.</td> </tr> <tr> <td><a href="#count" data-linktype="self-bookmark">count</a></td> <td>Return the number of items in the collection.</td> </tr> <tr> <td><a href="#foreach" data-linktype="self-bookmark">foreach</a></td> <td>Operate on each element and return the new collection.</td> </tr> <tr> <td><a href="#union" data-linktype="self-bookmark">union</a></td> <td>Return a collection that has all the items from the specified collections.</td> </tr> <tr> <td><a href="#skip" data-linktype="self-bookmark">skip</a></td> <td>Remove items from the front of a collection, and return the remaining items.</td> </tr> <tr> <td><a href="#take" data-linktype="self-bookmark">take</a></td> <td>Return items from the front of a collection.</td> </tr> <tr> <td><a href="#intersection" data-linktype="self-bookmark">intersection</a></td> <td>Return a collection that has only the common items across the specified collections.</td> </tr> <tr> <td><a href="#subArray" data-linktype="self-bookmark">subArray</a></td> <td>Return a subarray from specified start and end position. Index values start with the number 0.</td> </tr> <tr> <td><a href="#select" data-linktype="self-bookmark">select</a></td> <td>Operate on each element and return the new collection of transformed elements.</td> </tr> <tr> <td><a href="#where" data-linktype="self-bookmark">where</a></td> <td>Filter on each element and return the new collection of filtered elements which match the specific condition.</td> </tr> <tr> <td><a href="#sortBy" data-linktype="self-bookmark">sortBy</a></td> <td>Sort elements in the collection in ascending order and return the sorted collection.</td> </tr> <tr> <td><a href="#sortByDescending" data-linktype="self-bookmark">sortByDescending</a></td> <td>Sort elements in the collection in descending order and return the sorted collection.</td> </tr> <tr> <td><a href="#indicesAndValues" data-linktype="self-bookmark">indicesAndValues</a></td> <td>Turn an array or object into an array of objects with index and value property.</td> </tr> <tr> <td><a href="#flatten" data-linktype="self-bookmark">flatten</a></td> <td>Flatten arrays into an array with non-array values.</td> </tr> <tr> <td><a href="#unique" data-linktype="self-bookmark">unique</a></td> <td>Remove all duplicates from an array.</td> </tr> <tr> <td><a href="#any" data-linktype="self-bookmark">any</a></td> <td>Determines whether any elements of a sequence satisfy a condition.</td> </tr> <tr> <td><a href="#all" data-linktype="self-bookmark">all</a></td> <td>Determine whether all elements of a sequence satisfy a condition.</td> </tr> <tr> <td><a href="#reverse" data-linktype="self-bookmark">reverse</a></td> <td>Reverse the order of the elements in a string or array.</td> </tr> <tr> <td><a href="#merge" data-linktype="self-bookmark">merge</a></td> <td>Merges multiple JSON objects or items in an array together.</td> </tr> </tbody> </table> <h2 id="logical-comparison-functions">Logical comparison functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#and" data-linktype="self-bookmark">and</a></td> <td>Logical and. Return true if all specified expressions evaluate to true.</td> </tr> <tr> <td><a href="#equals" data-linktype="self-bookmark">equals</a></td> <td>Comparison equal. Return true if specified values are equal.</td> </tr> <tr> <td><a href="#empty" data-linktype="self-bookmark">empty</a></td> <td>Check if the target is empty.</td> </tr> <tr> <td><a href="#greater" data-linktype="self-bookmark">greater</a></td> <td>Comparison greater than. Return <code>true</code> if the first value is more, or return <code>false</code> if less.</td> </tr> <tr> <td><a href="#greaterOrEquals" data-linktype="self-bookmark">greaterOrEquals</a></td> <td>Comparison greater than or equal to. Return <code>true</code> if the first value is greater or equal, or return <code>false</code> if the first value is less.</td> </tr> <tr> <td><a href="#if" data-linktype="self-bookmark">if</a></td> <td>Check whether an expression is true or false. Based on the result, return a specified value.</td> </tr> <tr> <td><a href="#less" data-linktype="self-bookmark">less</a></td> <td>Comparison less than operation. Return <code>true</code> if the first value is less, or return <code>false</code> if the first value is more.</td> </tr> <tr> <td><a href="#lessOrEquals" data-linktype="self-bookmark">lessOrEquals</a></td> <td>Comparison less than or equal operation. Return <code>true</code> if the first value is less than or equal, or return <code>false</code> if the first value is more.</td> </tr> <tr> <td><a href="#not" data-linktype="self-bookmark">not</a></td> <td>Logical not operator. Return <code>true</code> if the expression is false, or return <code>false</code> if true.</td> </tr> <tr> <td><a href="#or" data-linktype="self-bookmark">or</a></td> <td>Logical or operation. Return <code>true</code> if at least one expression is true, or return <code>false</code> if all are false.</td> </tr> <tr> <td><a href="#exists" data-linktype="self-bookmark">exists</a></td> <td>Evaluate an expression for truthiness.</td> </tr> </tbody> </table> <h2 id="conversion-functions">Conversion functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#float" data-linktype="self-bookmark">float</a></td> <td>Return the floating point representation of the specified string.</td> </tr> <tr> <td><a href="#int" data-linktype="self-bookmark">int</a></td> <td>Return the integer representation of the specified string.</td> </tr> <tr> <td><a href="#string" data-linktype="self-bookmark">string</a></td> <td>Return the string version of the specified value in an optional locale format.</td> </tr> <tr> <td><a href="#bool" data-linktype="self-bookmark">bool</a></td> <td>Return the Boolean representation of the specified string.</td> </tr> <tr> <td><a href="#createArray" data-linktype="self-bookmark">createArray</a></td> <td>Create an array from multiple inputs.</td> </tr> <tr> <td><a href="#json" data-linktype="self-bookmark">json</a></td> <td>Return the JavaScript Object Notation (JSON) type value or object of a string or XML.</td> </tr> <tr> <td><a href="#base64" data-linktype="self-bookmark">base64</a></td> <td>Return the base64-encoded version of a string or byte array.</td> </tr> <tr> <td><a href="#base64ToBinary" data-linktype="self-bookmark">base64ToBinary</a></td> <td>Return the binary version for a base64-encoded string.</td> </tr> <tr> <td><a href="#base64ToString" data-linktype="self-bookmark">base64ToString</a></td> <td>Return the string version of a base64-encoded string.</td> </tr> <tr> <td><a href="#binary" data-linktype="self-bookmark">binary</a></td> <td>Return the binary version for an input value.</td> </tr> <tr> <td><a href="#dataUri" data-linktype="self-bookmark">dataUri</a></td> <td>Return the URI for an input value.</td> </tr> <tr> <td><a href="#dataUriToBinary" data-linktype="self-bookmark">dataUriToBinary</a></td> <td>Return the binary version of a data URI.</td> </tr> <tr> <td><a href="#dataUriToString" data-linktype="self-bookmark">dataUriToString</a></td> <td>Return the string version of a data URI.</td> </tr> <tr> <td><a href="#uriComponent" data-linktype="self-bookmark">uriComponent</a></td> <td>Return the URI-encoded version for an input value by replacing URL-unsafe characters with escape characters.</td> </tr> <tr> <td><a href="#uriComponentToString" data-linktype="self-bookmark">uriComponentToString</a></td> <td>Return the string version of a URI-encoded string.</td> </tr> <tr> <td><a href="#xml" data-linktype="self-bookmark">xml</a></td> <td>Return the XML version of a string.</td> </tr> <tr> <td><a href="#formatNumber" data-linktype="self-bookmark">formatNumber</a></td> <td>Format a value to the nearest number to the specified number of fractional digits and an optional specified locale.</td> </tr> <tr> <td><a href="#jsonStringify" data-linktype="self-bookmark">jsonStringify</a></td> <td>Return the JSON string of a value.</td> </tr> <tr> <td><a href="#stringOrValue" data-linktype="self-bookmark">stringOrValue</a> Wrap string interpolation to get the real value. For example, <code>stringOrValue('${1}')</code> returns the number 1, while <code>stringOrValue('${1} item')</code> returns the string "1 item".</td> <td></td> </tr> </tbody> </table> <h2 id="math-functions">Math functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#abs" data-linktype="self-bookmark">abs</a></td> <td>Returns the absolute value of the specified number.</td> </tr> <tr> <td><a href="#add" data-linktype="self-bookmark">add</a></td> <td>Mathematical and. Return the result from adding two numbers (pure number case) or concatenating two or more strings.</td> </tr> <tr> <td><a href="#div" data-linktype="self-bookmark">div</a></td> <td>Mathematical division. Return the integer result from dividing two numbers.</td> </tr> <tr> <td><a href="#max" data-linktype="self-bookmark">max</a></td> <td>Return the largest value from a collection.</td> </tr> <tr> <td><a href="#min" data-linktype="self-bookmark">min</a></td> <td>Return the smallest value from a collection.</td> </tr> <tr> <td><a href="#mod" data-linktype="self-bookmark">mod</a></td> <td>Return the remainder from dividing two numbers.</td> </tr> <tr> <td><a href="#mul" data-linktype="self-bookmark">mul</a></td> <td>Mathematical multiplication. Return the product from multiplying two numbers.</td> </tr> <tr> <td><a href="#rand" data-linktype="self-bookmark">rand</a></td> <td>Return a random number between specified min and max value.</td> </tr> <tr> <td><a href="#sqrt" data-linktype="self-bookmark">sqrt</a></td> <td>Return the square root of a specified number.</td> </tr> <tr> <td><a href="#sub" data-linktype="self-bookmark">sub</a></td> <td>Mathematical subtraction. Return the result from subtracting the second number from the first number.</td> </tr> <tr> <td><a href="#sum" data-linktype="self-bookmark">sum</a></td> <td>Return the sum of numbers in an array.</td> </tr> <tr> <td><a href="#range" data-linktype="self-bookmark">range</a></td> <td>Return an integer array that starts from a specified integer.</td> </tr> <tr> <td><a href="#exp" data-linktype="self-bookmark">exp</a></td> <td>Return exponentiation of one number to another.</td> </tr> <tr> <td><a href="#average" data-linktype="self-bookmark">average</a></td> <td>Return the average number of an numeric array.</td> </tr> <tr> <td><a href="#floor" data-linktype="self-bookmark">floor</a></td> <td>Return the largest integral value less than or equal to the specified number.</td> </tr> <tr> <td><a href="#ceiling" data-linktype="self-bookmark">ceiling</a></td> <td>Return the smallest integral value greater than or equal to the specified number.</td> </tr> <tr> <td><a href="#round" data-linktype="self-bookmark">round</a></td> <td>Round a value to the nearest integer or to the specified number of fractional digits.</td> </tr> </tbody> </table> <h2 id="date-and-time-functions">Date and time functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#addDays" data-linktype="self-bookmark">addDays</a></td> <td>Add a number of specified days to a given timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#addHours" data-linktype="self-bookmark">addHours</a></td> <td>Add a specified number of hours to a given timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#addMinutes" data-linktype="self-bookmark">addMinutes</a></td> <td>Add a specified number of minutes to a given timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#addSeconds" data-linktype="self-bookmark">addSeconds</a></td> <td>Add a specified number of seconds to a given timestamp.</td> </tr> <tr> <td><a href="#dayOfMonth" data-linktype="self-bookmark">dayOfMonth</a></td> <td>Return the day of a month for a given timestamp or Timex expression.</td> </tr> <tr> <td><a href="#dayOfWeek" data-linktype="self-bookmark">dayOfWeek</a></td> <td>Return the day of the week for a given timestamp.</td> </tr> <tr> <td><a href="#dayOfYear" data-linktype="self-bookmark">dayOfYear</a></td> <td>Return the day of the year for a given timestamp.</td> </tr> <tr> <td><a href="#formatDateTime" data-linktype="self-bookmark">formatDateTime</a></td> <td>Return a timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#formatEpoch" data-linktype="self-bookmark">formatEpoch</a></td> <td>Return a timestamp in an optional locale format from UNIX Epoch time (Unix time, POSIX time).</td> </tr> <tr> <td><a href="#formatTicks" data-linktype="self-bookmark">formatTicks</a></td> <td>Return a timestamp in an optional locale format from ticks.</td> </tr> <tr> <td><a href="#subtractFromTime" data-linktype="self-bookmark">subtractFromTime</a></td> <td>Subtract a number of time units from a timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#utcNow" data-linktype="self-bookmark">utcNow</a></td> <td>Return the current timestamp in an optional locale format as a string.</td> </tr> <tr> <td><a href="#dateReadBack" data-linktype="self-bookmark">dateReadBack</a></td> <td>Use the date-time library to provide a date readback.</td> </tr> <tr> <td><a href="#month" data-linktype="self-bookmark">month</a></td> <td>Return the month of given timestamp.</td> </tr> <tr> <td><a href="#date" data-linktype="self-bookmark">date</a></td> <td>Return the date for a given timestamp.</td> </tr> <tr> <td><a href="#year" data-linktype="self-bookmark">year</a></td> <td>Return the year for the given timestamp.</td> </tr> <tr> <td><a href="#getTimeOfDay" data-linktype="self-bookmark">getTimeOfDay</a></td> <td>Return the time of day for a given timestamp.</td> </tr> <tr> <td><a href="#getFutureTime" data-linktype="self-bookmark">getFutureTime</a></td> <td>Return the current timestamp in an optional locale format plus the specified time units.</td> </tr> <tr> <td><a href="#getPastTime" data-linktype="self-bookmark">getPastTime</a></td> <td>Return the current timestamp in an optional locale format minus the specified time units.</td> </tr> <tr> <td><a href="#addToTime" data-linktype="self-bookmark">addToTime</a></td> <td>Add a number of time units to a timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#convertFromUTC" data-linktype="self-bookmark">convertFromUTC</a></td> <td>Convert a timestamp in an optional locale format from Universal Time Coordinated (UTC).</td> </tr> <tr> <td><a href="#convertToUTC" data-linktype="self-bookmark">convertToUTC</a></td> <td>Convert a timestamp in an optional locale format to Universal Time Coordinated (UTC).</td> </tr> <tr> <td><a href="#startOfDay" data-linktype="self-bookmark">startOfDay</a></td> <td>Return the start of the day for a timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#startOfHour" data-linktype="self-bookmark">startOfHour</a></td> <td>Return the start of the hour for a timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#startOfMonth" data-linktype="self-bookmark">startOfMonth</a></td> <td>Return the start of the month for a timestamp in an optional locale format.</td> </tr> <tr> <td><a href="#ticks" data-linktype="self-bookmark">ticks</a></td> <td>Return the ticks property value of a specified timestamp.</td> </tr> <tr> <td><a href="#ticksToDays" data-linktype="self-bookmark">ticksToDays</a></td> <td>Convert a ticks property value to the number of days.</td> </tr> <tr> <td><a href="#ticksToHours" data-linktype="self-bookmark">ticksToHours</a></td> <td>Convert a ticks property value to the number of hours.</td> </tr> <tr> <td><a href="#ticksToMinutes" data-linktype="self-bookmark">ticksToMinutes</a></td> <td>Convert a ticks property value to the number of minutes.</td> </tr> <tr> <td><a href="#dateTimeDiff" data-linktype="self-bookmark">dateTimeDiff</a></td> <td>Return the difference in ticks between two timestamps.</td> </tr> <tr> <td><a href="#getPreviousViableDate" data-linktype="self-bookmark">getPreviousViableDate</a></td> <td>Return the previous viable date of a Timex expression based on the current date and an optionally specified timezone.</td> </tr> <tr> <td><a href="#getNextViableDate" data-linktype="self-bookmark">getNextViableDate</a></td> <td>Return the next viable date of a Timex expression based on the current date and an optionally specified timezone.</td> </tr> <tr> <td><a href="#getPreviousViableTime" data-linktype="self-bookmark">getPreviousViableTime</a></td> <td>Return the previous viable time of a Timex expression based on the current time and an optionally specified timezone.</td> </tr> <tr> <td><a href="#getNextViableTime" data-linktype="self-bookmark">getNextViableTime</a></td> <td>Return the next viable time of a Timex expression based on the current time and an optionally specified timezone.</td> </tr> </tbody> </table> <h2 id="timex-functions">Timex functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#isPresent" data-linktype="self-bookmark">isPresent</a></td> <td>Return true if the TimexProperty or Timex expression refers to the present.</td> </tr> <tr> <td><a href="#isDuration" data-linktype="self-bookmark">isDuration</a></td> <td>Return true if the TimexProperty or Timex expression refers to a duration.</td> </tr> <tr> <td><a href="#isTime" data-linktype="self-bookmark">isTime</a></td> <td>Return true if the TimexProperty or Timex expression refers to a time.</td> </tr> <tr> <td><a href="#isDate" data-linktype="self-bookmark">isDate</a></td> <td>Return true if the TimexProperty or Timex expression refers to a date.</td> </tr> <tr> <td><a href="#isTimeRange" data-linktype="self-bookmark">isTimeRange</a></td> <td>Return true if the TimexProperty or Timex expression refers to a time range.</td> </tr> <tr> <td><a href="#isDateRange" data-linktype="self-bookmark">isDateRange</a></td> <td>Return true if the TimexProperty or Timex expression refers to a date range.</td> </tr> <tr> <td><a href="#isDefinite" data-linktype="self-bookmark">isDefinite</a></td> <td>Return true if the TimexProperty or Timex expression refers to a definite day.</td> </tr> <tr> <td><a href="#resolve" data-linktype="self-bookmark">resolve</a></td> <td>Return a string of a given TimexProperty or Timex expression if it refers to a valid time. Valid time contains hours, minutes, and seconds.</td> </tr> </tbody> </table> <h2 id="uri-parsing-functions">URI parsing functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#uriHost" data-linktype="self-bookmark">uriHost</a></td> <td>Return the host value of a uniform resource identifier (URI).</td> </tr> <tr> <td><a href="#uriPath" data-linktype="self-bookmark">uriPath</a></td> <td>Return the path value of a uniform resource identifier (URI).</td> </tr> <tr> <td><a href="#uriPathAndQuery" data-linktype="self-bookmark">uriPathAndQuery</a></td> <td>Return the path and query values for a uniform resource identifier (URI).</td> </tr> <tr> <td><a href="#uriPort" data-linktype="self-bookmark">uriPort</a></td> <td>Return the port value of a uniform resource identifier (URI).</td> </tr> <tr> <td><a href="#uriQuery" data-linktype="self-bookmark">uriQuery</a></td> <td>Retur0sn the query value of a uniform resource identifier (URI).</td> </tr> <tr> <td><a href="#uriScheme" data-linktype="self-bookmark">uriScheme</a></td> <td>Return the scheme value of a uniform resource identifier (URI).</td> </tr> </tbody> </table> <h2 id="object-manipulation-and-construction-functions">Object manipulation and construction functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#addProperty" data-linktype="self-bookmark">addProperty</a></td> <td>Add a property and its value, or name-value pair, to a JSON object and return the updated object.</td> </tr> <tr> <td><a href="#removeProperty" data-linktype="self-bookmark">removeProperty</a></td> <td>Remove a property from JSON object and return the updated object.</td> </tr> <tr> <td><a href="#setProperty" data-linktype="self-bookmark">setProperty</a></td> <td>Set the value of a JSON object's property and return the updated object.</td> </tr> <tr> <td><a href="#getProperty" data-linktype="self-bookmark">getProperty</a></td> <td>Return the value of a specified property or root property from a JSON object.</td> </tr> <tr> <td><a href="#coalesce" data-linktype="self-bookmark">coalesce</a></td> <td>Return the first non-null value from one or more parameters.</td> </tr> <tr> <td><a href="#xPath" data-linktype="self-bookmark">xPath</a></td> <td>Check XML for nodes or values that match an XPath (XML Path Language) expression, and return the matching nodes or values.</td> </tr> <tr> <td><a href="#jPath" data-linktype="self-bookmark">jPath</a></td> <td>Check JSON or a JSON string for nodes or value that match a path expression, and return the matching nodes.</td> </tr> <tr> <td><a href="#setPathToValue" data-linktype="self-bookmark">setPathToValue</a></td> <td>Set the value of a specific path and return the value.</td> </tr> </tbody> </table> <h2 id="regular-expression-functions">Regular expression functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#isMatch" data-linktype="self-bookmark">isMatch</a></td> <td>Return true if a string matches a common regex pattern.</td> </tr> </tbody> </table> <h2 id="type-checking-functions">Type checking functions</h2> <table> <thead> <tr> <th>Function</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><a href="#EOL" data-linktype="self-bookmark">EOL</a></td> <td>Return the end of line (EOL) sequence text.</td> </tr> <tr> <td><a href="#isInteger" data-linktype="self-bookmark">isInteger</a></td> <td>Return true if given input is an integer number</td> </tr> <tr> <td><a href="#isFloat" data-linktype="self-bookmark">isFloat</a></td> <td>Return true if the given input is a float point number</td> </tr> <tr> <td><a href="#isBoolean" data-linktype="self-bookmark">isBoolean</a></td> <td>Return true if the given input is a Boolean.</td> </tr> <tr> <td><a href="#isArray" data-linktype="self-bookmark">isArray</a></td> <td>Return true if the given input is an array.</td> </tr> <tr> <td><a href="#isObject" data-linktype="self-bookmark">isObject</a></td> <td>Return true if the given input is an object.</td> </tr> <tr> <td><a href="#isDateTime" data-linktype="self-bookmark">isDateTime</a></td> <td>Return true if the given input is a UTC ISO format timestamp.</td> </tr> <tr> <td><a href="#isString" data-linktype="self-bookmark">isString</a></td> <td>Returns <strong>true</strong> if the given input is a string.</td> </tr> </tbody> </table> <h2 id="prebuilt-functions-sorted-alphabetically">Prebuilt functions sorted alphabetically</h2> <p><a name="abs"></a></p> <h3 id="abs">abs</h3> <p>Return the absolute value of the specified number.</p> <pre><code>abs(&lt;number&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number</em>&gt;</td> <td>Yes</td> <td>number</td> <td>Number to get absolute value of</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result</em>&gt;</td> <td>number</td> <td>The result from computing the absolute value.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples compute the absolute value:</p> <pre><code>abs(3.12134) abs(-3.12134) </code></pre> <p>And both return the result <strong>3.12134</strong>.</p> <p><a name="add"></a></p> <h3 id="add">add</h3> <p>Return the result from adding two or more numbers (pure number case) or concatenating two or more strings (other case).</p> <pre><code>add(&lt;item1&gt;, &lt;item2&gt;, ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>item1</em>&gt;, &lt;<em>item2</em>&gt;,...</td> <td>Yes</td> <td>any</td> <td>items</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result-sum</em>&gt;</td> <td>number or string</td> <td>The result from adding the specified numbers or the concat result.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example adds the specified numbers:</p> <pre><code>add(1, 1.5) </code></pre> <p>And returns the result <strong>2.5</strong>.</p> <p>This example concatenates the specified items:</p> <pre><code>add('hello',null) add('hello','world') </code></pre> <p>And returns the results</p> <ul> <li><strong>hello</strong></li> <li><strong>helloworld</strong></li> </ul> <p><a name="addDays"></a></p> <h3 id="adddays">addDays</h3> <p>Add a number of days to a timestamp in an optional locale format.</p> <pre><code>addDays('&lt;timestamp&gt;', &lt;days&gt;, '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp which must be standard UTC ISO format<br>YYYY-MM-DDTHH:mm:ss.fffZ</td> </tr> <tr> <td>&lt;<em>days</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The positive or negative number of days to add</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp plus the specified number of days</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example adds <strong>10</strong> days to the specified timestamp:</p> <pre><code>addDays('2018-03-15T13:00:00.000Z', 10) </code></pre> <p>And returns the result <strong>2018-03-25T00:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example subtracts five days from the specified timestamp:</p> <pre><code>addDays('2018-03-15T00:00:00.000Z', -5) </code></pre> <p>And returns the result <strong>2018-03-10T00:00:00.000Z</strong>.</p> <p><em>Example 3</em></p> <p>This example adds <strong>1</strong> day to the specified timestamp in the <strong>de-DE</strong> locale:</p> <pre><code>addDays('2018-03-15T13:00:00.000Z', 1, '', 'de-dE') </code></pre> <p>And returns the result <strong>16.03.18 13:00:00</strong>.</p> <p><a name="addHours"></a></p> <h3 id="addhours">addHours</h3> <p>Add a number of hours to a timestamp in an optional locale format.</p> <pre><code>addHours('&lt;timestamp&gt;', &lt;hours&gt;, '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>hours</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The positive or negative number of hours to add</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp plus the specified number of hours</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example adds <strong>10</strong> hours to the specified timestamp:</p> <pre><code>addHours('2018-03-15T00:00:00.000Z', 10) </code></pre> <p>And returns the result <strong>2018-03-15T10:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example subtracts five hours from the specified timestamp:</p> <pre><code>addHours('2018-03-15T15:00:00.000Z', -5) </code></pre> <p>And returns the result <strong>2018-03-15T10:00:00.000Z</strong>.</p> <p><em>Example 3</em></p> <p>This example adds <strong>2</strong> hours to the specified timestamp in the <strong>de-DE</strong> locale:</p> <pre><code>addHours('2018-03-15T13:00:00.000Z', 2, '', 'de-DE') </code></pre> <p>And returns the result <strong>15.03.18 15:00:00</strong>.</p> <p><a name="addMinutes"></a></p> <h3 id="addminutes">addMinutes</h3> <p>Add a number of minutes to a timestamp in an optional locale format.</p> <pre><code>addMinutes('&lt;timestamp&gt;', &lt;minutes&gt;, '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>minutes</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The positive or negative number of minutes to add</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp plus the specified number of minutes</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example adds <strong>10</strong> minutes to the specified timestamp:</p> <pre><code>addMinutes('2018-03-15T00:10:00.000Z', 10) </code></pre> <p>And returns the result <strong>2018-03-15T00:20:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example subtracts five minutes from the specified timestamp:</p> <pre><code>addMinutes('2018-03-15T00:20:00.000Z', -5) </code></pre> <p>And returns the result <strong>2018-03-15T00:15:00.000Z</strong>.</p> <p><em>Example 3</em></p> <p>This example adds <strong>30</strong> minutes to the specified timestamp in the <strong>de-DE</strong> locale:</p> <pre><code>addMinutes('2018-03-15T00:00:00.000Z', 30, '', 'de-DE') </code></pre> <p>And returns the result <strong>15.03.18 13:30:00</strong>.</p> <p><a name="addOrdinal"></a></p> <h3 id="addordinal">addOrdinal</h3> <p>Return the ordinal number of the input number.</p> <pre><code>addOrdinal(&lt;number&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The numbers to convert to an ordinal number</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result</em>&gt;</td> <td>string</td> <td>The ordinal number converted from the input number</td> </tr> </tbody> </table> <p><em>Example</em></p> <pre><code>addOrdinal(11) addOrdinal(12) addOrdinal(13) addOrdinal(21) addOrdinal(22) addOrdinal(23) </code></pre> <p>And respectively returns these results:</p> <ul> <li><strong>11th</strong></li> <li><strong>12th</strong></li> <li><strong>13th</strong></li> <li><strong>21st</strong></li> <li><strong>22nd</strong></li> <li><strong>23rd</strong></li> </ul> <p><a name="addProperty"></a></p> <h3 id="addproperty">addProperty</h3> <p>Add a property and its value, or name-value pair, to a JSON object, and return the updated object. If the object already exists at runtime the function throws an error.</p> <pre><code>addProperty('&lt;object&gt;', '&lt;property&gt;', value) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object</em>&gt;</td> <td>Yes</td> <td>object</td> <td>The JSON object where you want to add a property</td> </tr> <tr> <td>&lt;<em>property</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The name of the property to add</td> </tr> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The value of the property</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-object</em>&gt;</td> <td>object</td> <td>The updated JSON object after adding a new property</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example adds the <strong>accountNumber</strong> property to the <strong>customerProfile</strong> object, which is converted to JSON with the <a href="#json" data-linktype="self-bookmark">json()</a> function. The function assigns a value that is generated by the <a href="#newGuid" data-linktype="self-bookmark">newGuid()</a> function, and returns the updated object:</p> <pre><code>addProperty(json('customerProfile'), 'accountNumber', newGuid()) </code></pre> <p><a name="addSeconds"></a></p> <h3 id="addseconds">addSeconds</h3> <p>Add a number of seconds to a timestamp.</p> <pre><code>addSeconds('&lt;timestamp&gt;', &lt;seconds&gt;, '&lt;format&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>seconds</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The positive or negative number of seconds to add</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp plus the specified number of seconds</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example adds 10 seconds to the specified timestamp:</p> <pre><code>addSeconds('2018-03-15T00:00:00.000Z', 10) </code></pre> <p>And returns the result <strong>2018-03-15T00:00:10.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example subtracts five seconds to the specified timestamp:</p> <pre><code>addSeconds('2018-03-15T00:00:30.000Z', -5) </code></pre> <p>And returns the result <strong>2018-03-15T00:00:25.000Z</strong>.</p> <p><a name="addToTime"></a></p> <h3 id="addtotime">addToTime</h3> <p>Add a number of time units to a timestamp in an optional locale format. See also <a href="#getFutureTime" data-linktype="self-bookmark">getFutureTime()</a>.</p> <pre><code>addToTime('&lt;timestamp&gt;', '&lt;interval&gt;', &lt;timeUnit&gt;, '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>interval</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The number of specified time units to add</td> </tr> <tr> <td>&lt;<em>timeUnit</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The unit of time to use with <em>interval</em>. Possible units are "Second", "Minute", "Hour", "Day", "Week", "Month", and "Year".</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp plus the number of specified time units with given format.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example adds one day to specified timestamp.</p> <pre><code>addToTime('2018-01-01T00:00:00.000Z', 1, 'Day') </code></pre> <p>And returns the result <strong>2018-01-02T00:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example adds two weeks to the specified timestamp.</p> <pre><code>addToTime('2018-01-01T00:00:00.000Z', 2, 'Week', 'MM-DD-YY') </code></pre> <p>And returns the result in the 'MM-DD-YY' format as <strong>01-15-18</strong>.</p> <p><a name="all"></a></p> <h3 id="all">all</h3> <p>Determine whether all elements of a sequence satisfy a condition.</p> <pre><code>all(&lt;sequence&gt;, &lt;item&gt;, &lt;condition&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>sequence</em>&gt;</td> <td>Yes</td> <td>object</td> <td>A sequence to be evaluated.</td> </tr> <tr> <td>&lt;<em>item</em>&gt;</td> <td>Yes</td> <td>string</td> <td>Refers to the elements to evaluate in the sequence.</td> </tr> <tr> <td>&lt;<em>condition</em>&gt;</td> <td>Yes</td> <td>expression</td> <td>The expression to evaluate the condition.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if all elements satisfy a condition. Return <code>false</code> if at least one doesn't.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples determine if all elements of a sequence satisfy a condition:</p> <pre><code>all(createArray(1, 'cool'), item, isInteger(item)) all(createArray(1, 2), item =&gt; isInteger(item)) </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>false</strong>, because both items in the sequence aren't integers.</li> <li><strong>true</strong>, because both items in the sequence are integers.</li> </ul> <p><a name="and"></a></p> <h3 id="and">and</h3> <p>Check whether all expressions are true. Return <code>true</code> if all expressions are true, or return <code>false</code> if at least one expression is false.</p> <pre><code>and(&lt;expression1&gt;, &lt;expression2&gt;, ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>expression1</em>&gt;, &lt;<em>expression2</em>&gt;, ...</td> <td>Yes</td> <td>Boolean</td> <td>The expressions to check</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if all expressions are true. Return <code>false</code> if at least one expression is false.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>These examples check whether the specified Boolean values are all true:</p> <pre><code>and(true, true) and(false, true) and(false, false) </code></pre> <p>And respectively returns these results:</p> <ul> <li>Both expressions are true, so the functions returns <code>true</code>.</li> <li>One expression is false, so the functions returns <code>false</code>.</li> <li>Both expressions are false, so the function returns <code>false</code>.</li> </ul> <p><em>Example 2</em></p> <p>These examples check whether the specified expressions are all true:</p> <pre><code>and(equals(1, 1), equals(2, 2)) and(equals(1, 1), equals(1, 2)) and(equals(1, 2), equals(1, 3)) </code></pre> <p>And respectively returns these results:</p> <ul> <li>Both expressions are true, so the functions returns <code>true</code>.</li> <li>One expression is false, so the functions returns <code>false</code>.</li> <li>Both expressions are false, so the functions returns <code>false</code>.</li> </ul> <p><a name="any"></a></p> <h3 id="any">any</h3> <p>Determine whether any elements of a sequence satisfy a condition.</p> <pre><code>all(&lt;sequence&gt;, &lt;item&gt;, &lt;condition&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>sequence</em>&gt;</td> <td>Yes</td> <td>object</td> <td>A sequence to be evaluated.</td> </tr> <tr> <td>&lt;<em>item</em>&gt;</td> <td>Yes</td> <td>string</td> <td>Refers to the elements to evaluate in the sequence.</td> </tr> <tr> <td>&lt;<em>condition</em>&gt;</td> <td>Yes</td> <td>expression</td> <td>The expression to evaluate the condition.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if all elements satisfy the condition. Return <code>false</code> if at least one doesn't.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples determine if all elements of a sequence satisfy a condition:</p> <pre><code>any(createArray(1, 'cool'), item, isInteger(item)) any(createArray('first', 'cool'), item =&gt; isInteger(item)) </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>true</strong>, because at least one item in the sequence is an integer</li> <li><strong>false</strong>, because neither item in the sequence is an integer.</li> </ul> <p><a name="average"></a></p> <h3 id="average">average</h3> <p>Return the number average of a numeric array.</p> <pre><code>average(&lt;numericArray&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>numericArray</em>&gt;</td> <td>Yes</td> <td>array of number</td> <td>The input array to calculate the average</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>average-of-array</em>&gt;</td> <td>number</td> <td>The average value of the given array</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example calculates the average of the array in <code>createArray()</code>:</p> <pre><code>average(createArray(1,2,3)) </code></pre> <p>And returns the result <strong>2</strong>.</p> <p><a name="base64"></a></p> <h3 id="base64">base64</h3> <p>Return the base64-encoded version of a string or byte array.</p> <pre><code>base64('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string or byte array</td> <td>The input string</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>base64-string</em>&gt;</td> <td>string</td> <td>The base64-encoded version of the input string</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example converts the string <strong>hello</strong> to a base64-encoded string:</p> <pre><code>base64('hello') </code></pre> <p>And returns the result <strong>"aGVsbG8="</strong>.</p> <p><em>Example 2</em></p> <p>This example takes <code>byteArr</code>, which equals <code>new byte[] { 3, 5, 1, 12 }</code>:</p> <pre><code>base64('byteArr') </code></pre> <p>And returns the result <strong>"AwUBDA=="</strong>.</p> <p><a name="base64ToBinary"></a></p> <h3 id="base64tobinary">base64ToBinary</h3> <p>Return the binary array of a base64-encoded string.</p> <pre><code>base64ToBinary('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The base64-encoded string to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>binary-for-base64-string</em>&gt;</td> <td>byte array</td> <td>The binary version of the base64-encoded string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts the base64-encoded string <strong>AwUBDA==</strong> to a binary string:</p> <pre><code>base64ToBinary('AwUBDA==') </code></pre> <p>And returns the result <strong>new byte[] { 3, 5, 1, 12 }</strong>.</p> <p><a name="base64ToString"></a></p> <h3 id="base64tostring">base64ToString</h3> <p>Return the string version of a base64-encoded string, effectively decoding the base64 string.</p> <pre><code>base64ToString('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The base64-encoded string to decode</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>decoded-base64-string</em>&gt;</td> <td>string</td> <td>The string version of a base64-encoded string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts the base64-encoded string <strong>aGVsbG8=</strong> to a decoded string:</p> <pre><code>base64ToString('aGVsbG8=') </code></pre> <p>And returns the result <strong>hello</strong>.</p> <p><a name="binary"></a></p> <h3 id="binary">binary</h3> <p>Return the binary version of a string.</p> <pre><code>binary('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>binary-for-input-value</em>&gt;</td> <td>byte array</td> <td>The binary version of the specified string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts the string <strong>hello</strong> to a binary string:</p> <pre><code>binary('hello') </code></pre> <p>And returns the result <strong>new byte[] { 104, 101, 108, 108, 111 }</strong>.</p> <p><a name="bool"></a></p> <h3 id="bool">bool</h3> <p>Return the Boolean version of a value.</p> <pre><code>bool(&lt;value&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The value to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>The Boolean version of the specified value</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples convert the specified values to Boolean values:</p> <pre><code>bool(1) bool(0) </code></pre> <p>And respectively returns these results:</p> <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> <p><a name="ceiling"></a></p> <h3 id="ceiling">ceiling</h3> <p>Return the largest integral value less than or equal to the specified number.</p> <pre><code>ceiling('&lt;number&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number</em>&gt;</td> <td>Yes</td> <td>number</td> <td>An input number</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>integer-value</em>&gt;</td> <td>integer</td> <td>The largest integral value greater than or equal to the input number</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example returns the largest integral value less than or equal to the number <strong>10.333</strong>:</p> <pre><code>ceiling(10.333) </code></pre> <p>And returns the integer <strong>11</strong>.</p> <p><a name="coalesce"></a></p> <h3 id="coalesce">coalesce</h3> <p>Return the first non-null value from one or more parameters. Empty strings, empty arrays, and empty objects are not null.</p> <pre><code>coalesce(&lt;object**1&gt;, &lt;object**2&gt;, ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object**1</em>&gt;, &lt;<em>object**2</em>&gt;, ...</td> <td>Yes</td> <td>any (mixed types acceptable)</td> <td>One or more items to check for null</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>first-non-null-item</em>&gt;</td> <td>any</td> <td>The first item or value that isn't null. If all parameters are null, this function returns null.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples return the first non-null value from the specified values, or null when all the values are null:</p> <pre><code>coalesce(null, true, false) coalesce(null, 'hello', 'world') coalesce(null, null, null) </code></pre> <p>And respectively return:</p> <ul> <li><code>true</code></li> <li><strong>hello</strong></li> <li>null</li> </ul> <p><a name="concat"></a></p> <h3 id="concat">concat</h3> <p>Combine two or more objects, and return the combined objects in a list or string.</p> <pre><code>concat('&lt;text1&gt;', '&lt;text2&gt;', ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object1</em>&gt;, &lt;<em>object2</em>&gt;, ...</td> <td>Yes</td> <td>any</td> <td>At least two objects to concat.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object1object2...</em>&gt;</td> <td>string or list</td> <td>The combined string or list. Null values are skipped.</td> </tr> </tbody> </table> <p>Expected return values:</p> <ul> <li>If all items are lists, a list will be returned.</li> <li>If there exists an item that isn't a list, a string will be returned.</li> <li>If a value is null, it's skipped and not concatenated.</li> </ul> <p><em>Example</em></p> <p>This example combines the strings <strong>Hello</strong> and <strong>World</strong>:</p> <pre><code>concat('Hello', 'World') </code></pre> <p>And returns the result <strong>HelloWorld</strong>.</p> <p><em>Example 2</em></p> <p>This example combines the lists <strong>[1,2]</strong> and <strong>[3,4]</strong>:</p> <pre><code>concat([1,2],[3,4]) </code></pre> <p>And returns the result <strong>[1,2,3,4]</strong>.</p> <p><em>Example 3</em></p> <p>These examples combine objects of different types:</p> <pre><code>concat('a', 'b', 1, 2) concat('a', [1,2]) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The string <strong>ab12</strong>.</li> <li>The object <strong>aSystem.Collections.Generic.List 1[System.Object]</strong>. This is unreadable and best to avoid.</li> </ul> <p><em>Example 4</em></p> <p>These examples combine objects will <code>null</code>:</p> <pre><code>concat([1,2], null) concat('a', 1, null) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The list <strong>[1,2]</strong>.</li> <li>The string <strong>a1</strong>.</li> </ul> <p><a name="contains"></a></p> <h3 id="contains">contains</h3> <p>Check whether a collection has a specific item. Return <code>true</code> if the item is found, or return <code>false</code> if not found. This function is case-sensitive.</p> <pre><code>contains('&lt;collection&gt;', '&lt;value&gt;') contains([&lt;collection&gt;], '&lt;value&gt;') </code></pre> <p>This function works on the following collection types:</p> <ul> <li>A string to find a substring</li> <li>An array to find a value</li> <li>A dictionary to find a key</li> </ul> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>string, array, or dictionary</td> <td>The collection to check</td> </tr> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string, array, or dictionary, respectively</td> <td>The item to find</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if the item is found. Return <code>false</code> if not found.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example checks the string <strong>hello world</strong> for the substring <strong>world</strong>:</p> <pre><code>contains('hello world', 'world') </code></pre> <p>And returns the result <code>true</code>.</p> <p><em>Example 2</em></p> <p>This example checks the string <strong>hello world</strong> for the substring <strong>universe</strong>:</p> <pre><code>contains('hello world', 'universe') </code></pre> <p>And returns the result <code>false</code>.</p> <p><a name="count"></a></p> <h3 id="count">count</h3> <p>Return the number of items in a collection.</p> <pre><code>count('&lt;collection&gt;') count([&lt;collection&gt;]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The collection with the items to count</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>length-or-count</em>&gt;</td> <td>integer</td> <td>The number of items in the collection</td> </tr> </tbody> </table> <p><em>Examples</em>:</p> <p>These examples count the number of items in these collections:</p> <pre><code>count('abcd') count(createArray(0, 1, 2, 3)) </code></pre> <p>And both return the result <strong>4</strong>.</p> <p><a name="countWord"></a></p> <h3 id="countword">countWord</h3> <p>Return the number of words in a string</p> <pre><code>countWord('&lt;text&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to count</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>count</em>&gt;</td> <td>integer</td> <td>The number of words in the string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example counts the number of words in the string <strong>hello world</strong>:</p> <pre><code>countWord("hello word") </code></pre> <p>And it returns the result <strong>2</strong>.</p> <p><a name="convertFromUTC"></a></p> <h3 id="convertfromutc">convertFromUTC</h3> <p>Convert a timestamp in an optional locale format from Universal Time Coordinated (UTC) to a target time zone.</p> <pre><code>convertFromUTC('&lt;timestamp&gt;', '&lt;destinationTimeZone&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>destinationTimeZone</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The name of the target time zone. Supports Windows and IANA time zones.</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is the <a href="/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#Roundtrip" data-linktype="absolute-path">"o" format</a>, yyyy-MM-ddTHH:mm:ss.fffffffK, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>converted-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp converted to the target time zone</td> </tr> </tbody> </table> <p><em>Examples</em>:</p> <p>These examples convert from UTC to Pacific Standard Time:</p> <pre><code>convertFromUTC('2018-02-02T02:00:00.000Z', 'Pacific Standard Time', 'MM-DD-YY') convertFromUTC('2018-02-02T02:00:00.000Z', 'Pacific Standard Time') </code></pre> <p>And respectively return these results:</p> <ul> <li><strong>02-01-18</strong></li> <li><strong>2018-01-01T18:00:00.0000000</strong></li> </ul> <p><em>Example 2</em></p> <p>This example converts a timestamp in the <strong>en-US</strong> locale from UTC to Pacific Standard Time:</p> <pre><code>convertFromUTC('2018-01-02T02:00:00.000Z', 'Pacific Standard Time', 'D', 'en-US') </code></pre> <p>And returns the result <strong>Monday, January 1, 2018</strong>.</p> <p><a name="convertToUTC"></a></p> <h3 id="converttoutc">convertToUTC</h3> <p>Convert a timestamp in an optional locale format to Universal Time Coordinated (UTC) from the source time zone.</p> <pre><code>convertToUTC('&lt;timestamp&gt;', '&lt;sourceTimeZone&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>sourceTimeZone</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The name of the target time zone. Supports Windows and IANA time zones.</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>converted-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp converted to the target time zone</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts a timestamp to UTC from Pacific Standard Time</p> <pre><code>convertToUTC('01/01/2018 00:00:00', 'Pacific Standard Time') </code></pre> <p>And returns the result <strong>2018-01-01T08:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example converts a timestamp in the <strong>de-DE</strong> locale to UTC from Pacific Standard Time:</p> <pre><code>convertToUTC('01/01/2018 00:00:00', 'Pacific Standard Time', '', 'de-DE') </code></pre> <p>And returns the result <strong>01.01.18 08:00:00</strong>.</p> <p><a name="createArray"></a></p> <h3 id="createarray">createArray</h3> <p>Return an array from multiple inputs.</p> <pre><code>createArray('&lt;object1&gt;', '&lt;object2&gt;', ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object1</em>&gt;, &lt;<em>object2</em>&gt;, ...</td> <td>Yes</td> <td>any, but not mixed</td> <td>At least two items to create the array</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>[&lt;<em>object1</em>&gt;, &lt;<em>object2</em>&gt;, ...]</td> <td>array</td> <td>The array created from all the input items</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates an array from the following inputs:</p> <pre><code>createArray('h', 'e', 'l', 'l', 'o') </code></pre> <p>And returns the result <strong>[h ,e, l, l, o]</strong>.</p> <p><a name="dataUri"></a></p> <h3 id="datauri">dataUri</h3> <p>Return a data uniform resource identifier (URI) of a string.</p> <pre><code>dataUri('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>[&lt;<em>date-uri</em>&gt;]</td> <td>string</td> <td>The data URI for the input string</td> </tr> </tbody> </table> <p><em>Example</em></p> <pre><code>dataUri('hello') </code></pre> <p>Returns the result <strong>data:text/plain;charset=utf-8;base64,aGVsbG8=</strong>.</p> <p><a name="dataUriToBinary"></a></p> <h3 id="datauritobinary">dataUriToBinary</h3> <p>Return the binary version of a data uniform resource identifier (URI).</p> <pre><code>dataUriToBinary('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The data URI to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>[&lt;<em>binary-for-data-uri</em>&gt;]</td> <td>byte array</td> <td>The binary version of the data URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates a binary version for the following data URI:</p> <pre><code>dataUriToBinary('aGVsbG8=') </code></pre> <p>And returns the result <strong>new byte[] { 97, 71, 86, 115, 98, 71, 56, 61 }</strong>.</p> <p><a name="dataUriToString"></a></p> <h3 id="datauritostring">dataUriToString</h3> <p>Return the string version of a data uniform resource identifier (URI).</p> <pre><code>dataUriToString('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The data URI to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>[&lt;<em>string-for-data-uri</em>&gt;]</td> <td>string</td> <td>The string version of the data URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates a string from the following data URI:</p> <pre><code>dataUriToString('data:text/plain;charset=utf-8;base64,aGVsbG8=') </code></pre> <p>And returns the result <strong>hello</strong>.</p> <p><a name="date"></a></p> <h3 id="date">date</h3> <p>Return the date of a specified timestamp in <strong>m/dd/yyyy</strong> format.</p> <pre><code>date('&lt;timestramp&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>date</em>&gt;</td> <td>string</td> <td>The date of the specified timestamp</td> </tr> </tbody> </table> <pre><code>date('2018-03-15T13:00:00.000Z') </code></pre> <p>Returns the result <strong>3-15-2018</strong>.</p> <p><a name="dateReadBack"></a></p> <h3 id="datereadback">dateReadBack</h3> <p>Uses the date-time library to provide a date readback.</p> <pre><code>dateReadBack('&lt;currentDate&gt;', '&lt;targetDate&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>currentDate</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the current date</td> </tr> <tr> <td>&lt;<em>targetDate</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the target date</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>date-readback</em>&gt;</td> <td>string</td> <td>The readback between current date and the target date</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <pre><code>dateReadBack('2018-03-15T13:00:00.000Z', '2018-03-16T13:00:00.000Z') </code></pre> <p>Returns the result <strong>tomorrow</strong>.</p> <p><a name="dateTimeDiff"></a></p> <h3 id="datetimediff">dateTimeDiff</h3> <p>Return the difference in ticks between two timestamps.</p> <pre><code>dateTimeDiff('&lt;timestamp1&gt;', '&lt;timestamp2&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp1</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The first timestamp string to compare</td> </tr> <tr> <td>&lt;<em>timestamp2</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The second timestamp string to compare</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>ticks</em>&gt;</td> <td>number</td> <td>The difference in ticks between two timestamps</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example returns the difference in ticks between two timestamps:</p> <pre><code>dateTimeDiff('2019-01-01T08:00:00.000Z','2018-01-01T08:00:00.000Z') </code></pre> <p>And returns the number <strong>315360000000000</strong>.</p> <p><em>Example 2</em></p> <p>This example returns the difference in ticks between two timestamps:</p> <pre><code>dateTimeDiff('2018-01-01T08:00:00.000Z', '2019-01-01T08:00:00.000Z') </code></pre> <p>Returns the result <strong>-315360000000000</strong>. The value is a negative number.</p> <p><a name="dayOfMonth"></a> <a name="dayOfMonth"></a></p> <h3 id="dayofmonth">dayOfMonth</h3> <p>Return the day of the month from a timestamp.</p> <pre><code>dayOfMonth('&lt;timestamp&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>day-of-month</em>&gt;</td> <td>integer</td> <td>The day of the month from the specified timestamp</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example returns the number for the day of the month from the following timestamp:</p> <pre><code>dayOfMonth('2018-03-15T13:27:36Z') </code></pre> <p>And returns the result <strong>15</strong>.</p> <p><a name="dayOfWeek"></a></p> <h3 id="dayofweek">dayOfWeek</h3> <p>Return the day of the week from a timestamp.</p> <pre><code>dayOfWeek('&lt;timestamp&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>day-of-week</em>&gt;</td> <td>integer</td> <td>The day of the week from the specified timestamp. Sunday is 0, Monday is 1, and so forth.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example returns the number for the day of the week from the following timestamp:</p> <pre><code>dayOfWeek('2018-03-15T13:27:36Z') </code></pre> <p>And returns the result <strong>3</strong>.</p> <p><a name="dayOfYear"></a></p> <h3 id="dayofyear">dayOfYear</h3> <p>Return the day of the year from a timestamp.</p> <pre><code>dayOfYear('&lt;timestamp&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>day-of-year</em>&gt;</td> <td>integer</td> <td>The day of the year from the specified timestamp</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example returns the number of the day of the year from the following timestamp:</p> <pre><code>dayOfYear('2018-03-15T13:27:36Z') </code></pre> <p>And returns the result <strong>74</strong>.</p> <p><a name="div"></a></p> <h3 id="div">div</h3> <p>Return the integer result from dividing two numbers. To return the remainder see <a href="#mod" data-linktype="self-bookmark">mod()</a>.</p> <pre><code>div(&lt;dividend&gt;, &lt;divisor&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>dividend</em>&gt;</td> <td>Yes</td> <td>number</td> <td>The number to divide by the <em>divisor</em></td> </tr> <tr> <td>&lt;<em>divisor</em>&gt;</td> <td>Yes</td> <td>number</td> <td>The number that divides the <em>dividend</em>. Can't be 0.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>quotient-result</em>&gt;</td> <td>number</td> <td>The result from dividing the first number by the second number</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>Both examples divide the first number by the second number:</p> <pre><code>div(10, 5) div(11, 5) </code></pre> <p>And return the result <strong>2</strong>.</p> <p>There exists some gap between Javascript and .NET SDK. For example, the following expression will return different results in Javascript and .NET SDK:</p> <p>If one of the parameters is a float, the result will also be a FLOAT with .NET SDK.</p> <p><em>Example</em></p> <pre><code>div(11.2, 2) </code></pre> <p>Returns the result <strong>5.6</strong>.</p> <p>If one of the parameters is a float, the result will be an INT with Javascript SDK.</p> <p><em>Example</em></p> <pre><code>div(11.2, 2) </code></pre> <p>Returns the result <strong>5</strong>.</p> <p>The workaround for Javascript to keep a certain number of decimal places in results is to use such expression. For example, to keep 3 decimal places:</p> <pre><code>float(concat(string(div(a, b)),'.',string(mod(div(a*1000, b), 1000)))) </code></pre> <p><a name="empty"></a></p> <h3 id="empty">empty</h3> <p>Check whether an instance is empty. Return <code>true</code> if the input is empty. Empty means:</p> <ul> <li>input is null or undefined</li> <li>input is a null or empty string</li> <li>input is zero size collection</li> <li>input is an object with no property.</li> </ul> <pre><code>empty('&lt;instance&gt;') empty([&lt;instance&gt;]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>instance</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The instance to check</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> when the instance is empty.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples check whether the specified instance is empty:</p> <pre><code>empty('') empty('abc') empty([1]) empty(null) </code></pre> <p>And return these results respectively:</p> <ul> <li>Passes an empty string, so the function returns <code>true</code>.</li> <li>Passes the string <strong>abc</strong>, so the function returns <code>false</code>.</li> <li>Passes the collection with one item, so the function returns <code>false</code>.</li> <li>Passes the null object, so the function returns <code>true</code>.</li> </ul> <p><a name="endsWith"></a></p> <h3 id="endswith">endsWith</h3> <p>Check whether a string ends with a specific substring. Return <code>true</code> if the substring is found, or return <code>false</code> if not found. This function is case-insensitive.</p> <pre><code>endsWith('&lt;text&gt;', '&lt;searchText&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to check</td> </tr> <tr> <td>&lt;<em>searchText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The ending substring to find</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> when the ending substring is found. Return <code>false</code> if not found</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example checks whether the <strong>hello world</strong> string ends with the string <strong>world</strong>:</p> <pre><code>endsWith('hello world', 'world') </code></pre> <p>And it returns the result <code>true</code>.</p> <p><em>Example 2</em></p> <p>This example checks whether the <strong>hello world</strong> string ends with the string <strong>universe</strong>:</p> <pre><code>endsWith('hello world', 'universe') </code></pre> <p>And it returns the result <code>false</code>.</p> <p><a name="EOL"></a></p> <h3 id="eol">EOL</h3> <p>Return the end of line (EOL) sequence text.</p> <pre><code>EOL() </code></pre> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>IsOSPlatform</em>&gt;</td> <td>string</td> <td>Return <strong>\r\n</strong> in Windows and <strong>\n</strong> in Mac and Linux.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example checks the end of the line sequence text:</p> <pre><code>EOL() </code></pre> <p>And returns the following strings:</p> <ul> <li>Windows: <strong>\r\n</strong></li> <li>Mac or Linux: <strong>\n</strong></li> </ul> <p><a name="equals"></a></p> <h3 id="equals">equals</h3> <p>Check whether both values, expressions, or objects are equivalent. Return <code>true</code> if both are equivalent, or return <code>false</code> if they're not equivalent.</p> <pre><code>equals('&lt;object1&gt;', '&lt;object2&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object1</em>&gt;, &lt;<em>object2</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The values, expressions, or objects to compare</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> when both are equivalent. Return <code>false</code> if not equivalent.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples check whether the specified inputs are equivalent:</p> <pre><code>equals(true, 1) equals('abc', 'abcd') </code></pre> <p>And returns these results respectively:</p> <ul> <li>Both values are equivalent, so the function returns <code>true</code>.</li> <li>Both values aren't equivalent, so the function returns <code>false</code>.</li> </ul> <p><a name="exists"></a></p> <h3 id="exists">exists</h3> <p>Evaluates an expression for truthiness.</p> <pre><code>exists(expression) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>expression</td> <td>Yes</td> <td>expression</td> <td>Expression to evaluate for truthiness</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>true or false</em>&gt;</td> <td>Boolean</td> <td>Result of evaluating the expression</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These example evaluate the truthiness of <code>foo = {"bar":"value"}</code>:</p> <pre><code>exists(foo.bar) exists(foo.bar2) </code></pre> <p>And return these results respectively:</p> <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> <p><a name="exp"></a></p> <h3 id="exp">exp</h3> <p>Return exponentiation of one number to another.</p> <pre><code>exp(realNumber, exponentNumber) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>realNumber</td> <td>Yes</td> <td>number</td> <td>Real number to compute exponent of</td> </tr> <tr> <td>exponentNumber</td> <td>Yes</td> <td>number</td> <td>Exponent number</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result-exp</em>&gt;</td> <td>number</td> <td>The result from computing exponent of <code>realNumber</code></td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example computes the exponent:</p> <pre><code>exp(2, 2) </code></pre> <p>And returns the result <strong>4</strong>.</p> <p><a name="first"></a></p> <h3 id="first">first</h3> <p>Return the first item from a string or array.</p> <pre><code>first('&lt;collection&gt;') first([&lt;collection&gt;]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The collection in which to find the first item</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>first-collection-item</em>&gt;</td> <td>any</td> <td>The first item in the collection</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples find the first item in the following collections:</p> <pre><code>first('hello') first(createArray(0, 1, 2)) </code></pre> <p>And return these results respectively:</p> <ul> <li><strong>h</strong></li> <li><strong>0</strong></li> </ul> <p><a name="flatten"></a></p> <h3 id="flatten">flatten</h3> <p>Flatten an array into non-array values. You can optionally set the maximum depth to flatten to.</p> <pre><code>flatten([&lt;collection&gt;], '&lt;depth&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>array</td> <td>The collection to flatten</td> </tr> <tr> <td>&lt;<em>depth</em>&gt;</td> <td>No</td> <td>number</td> <td>Maximum depth to flatten. Default is infinity.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>new-collection</em>&gt;</td> <td>array</td> <td>New collection whose elements have been flattened to a non-array to the specified depth</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>THis example flattens the following array:</p> <pre><code>flatten(createArray(1, createArray(2), createArray(createArray(3, 4), createArray(5, 6))) </code></pre> <p>And returns the result <strong>[1, 2, 3, 4, 5, 6]</strong>.</p> <p><em>Example 2</em></p> <p>This example flattens the array to a depth of <strong>1</strong>:</p> <pre><code>flatten(createArray(1, createArray(2), createArray(createArray(3, 4), createArray(5, 6)), 1) </code></pre> <p>And returns the result <strong>[1, 2, [3, 4], [5, 6]]</strong>.</p> <p><a name="float"></a></p> <h3 id="float">float</h3> <p>Convert the string version of a floating-point number to a floating-point number. You can use this function only when passing custom parameters to an app, such as a logic app. An exception will be thrown if the string can't be converted to a float.</p> <pre><code>float('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that has a valid floating-point number to convert to</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>float-value</em>&gt;</td> <td>float</td> <td>The floating-point number of the specified string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts the float version of a string:</p> <pre><code>float('10.333') </code></pre> <p>And returns the float <strong>10.333</strong>.</p> <p><a name="floor"></a></p> <h3 id="floor">floor</h3> <p>Return the largest integral value less than or equal to the specified number.</p> <pre><code>floor('&lt;number&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number</em>&gt;</td> <td>Yes</td> <td>number</td> <td>An input number</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>integer-value</em>&gt;</td> <td>integer</td> <td>The largest integral value less than or equal to the input number</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example calculates the floor value of the number <strong>10.333</strong>:</p> <pre><code>floor(10.333) </code></pre> <p>And returns the integer <strong>10</strong>.</p> <p><a name="foreach"></a></p> <h3 id="foreach">foreach</h3> <p>Operate on each element and return the new collection.</p> <pre><code>foreach([&lt;collection/instance&gt;], &lt;iteratorName&gt;, &lt;function&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection/instance</em>&gt;</td> <td>Yes</td> <td>array or object</td> <td>The collection with the items</td> </tr> <tr> <td>&lt;<em>iteratorName</em>&gt;</td> <td>Yes</td> <td>iterator name</td> <td>The key item of arrow function</td> </tr> <tr> <td>&lt;<em>function</em>&gt;</td> <td>Yes</td> <td>expression</td> <td>Function that contains <code>iteratorName</code></td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>new-collection</em>&gt;</td> <td>array</td> <td>The new collection in which each element has been evaluated by the function</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example generates a new collection:</p> <pre><code>foreach(createArray(0, 1, 2, 3), x, x + 1) </code></pre> <p>And returns the result <strong>[1, 2, 3, 4]</strong>.</p> <p><em>Example 2</em></p> <p>These examples generate a new collection:</p> <pre><code>foreach(json("{'name': 'jack', 'age': '15'}"), x, concat(x.key, ':', x.value)) foreach(json("{'name': 'jack', 'age': '15'}"), x=&gt; concat(x.key, ':', x.value)) </code></pre> <p>And return the result <strong>['name:jack', 'age:15']</strong>. Note that the second expression is a <em>lambda expression</em>, which some find more readable.</p> <p><a name="formatDateTime"></a></p> <h3 id="formatdatetime">formatDateTime</h3> <p>Return a timestamp in an optional locale format.</p> <pre><code>formatDateTime('&lt;timestamp&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>reformatted-timestamp</em>&gt;</td> <td>string</td> <td>The updated timestamp in the specified format</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example converts a timestamp to the specified format:</p> <pre><code>formatDateTime('03/15/2018 12:00:00', 'yyyy-MM-ddTHH:mm:ss') </code></pre> <p>And returns the result <strong>2018-03-15T12:00:00</strong>.</p> <p><em>Example 2</em></p> <p>This example converts a timestamp in the <strong>de-DE</strong> locale:</p> <pre><code>formatDateTime('2018-03-15', '', 'de-DE') </code></pre> <p>And returns the result <strong>15.03.18 00:00:00</strong>.</p> <p><a name="formatEpoch"></a></p> <h3 id="formatepoch">formatEpoch</h3> <p>Return a timestamp in an optional locale format in the specified format from UNIX time (also know as Epoch time, POSIX time, UNIX Epoch time).</p> <pre><code>formatEpoch('&lt;epoch&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>epoch</em>&gt;</td> <td>Yes</td> <td>number</td> <td>The epoch number</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>reformatted-timestamp</em>&gt;</td> <td>string</td> <td>The updated timestamp in the specified format</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts a Unix timestamp to the specified format:</p> <pre><code>formatEpoch(1521118800, 'yyyy-MM-ddTHH:mm:ss.fffZ)' </code></pre> <p>And returns the result <strong>2018-03-15T12:00:00.000Z</strong>.</p> <p><em>Example</em></p> <p>This example converts a Unix timestamp in the <strong>de-DE</strong> locale:</p> <pre><code>formatEpoch(1521118800, '', 'de-DE') </code></pre> <p>And returns the result <strong>15.03.18 13:00:00</strong>.</p> <p><a name="formatNumber"></a></p> <h3 id="formatnumber">formatNumber</h3> <p>Format a value to the specified number of fractional digits and an optional specified locale.</p> <pre><code>formatNumber('&lt;number&gt;', '&lt;precision-digits&gt;', '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number</em>&gt;</td> <td>Yes</td> <td>number</td> <td>An input number</td> </tr> <tr> <td>&lt;<em>precision-digits</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>A specified number of fractional digits</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>return-value</em>&gt;</td> <td>number</td> <td>The return value of the input formatted at a specified number of fractional digits and a specified locale</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example formats the number <strong>10.333</strong> to <strong>2</strong> fractional digits:</p> <pre><code>formatNumber(10.333, 2) </code></pre> <p>And returns the string <strong>10.33</strong>.</p> <p><em>Example 2</em></p> <p>These examples format numbers to a specified number of digits in the <strong>en-US</strong> locale:</p> <pre><code>formatNumber(12.123, 2, 'en-US') formatNumber(1.551, 2, 'en-US') formatNumber(12.123, 4, 'en-US') </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>12.12</strong></li> <li><strong>1.55</strong></li> <li><strong>12.1230</strong></li> </ul> <p><a name="formatTicks"></a></p> <h3 id="formatticks">formatTicks</h3> <p>Return a timestamp in an optional locale format in the specified format from ticks.</p> <pre><code>formatTicks('&lt;ticks&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>epoch</em>&gt;</td> <td>Yes</td> <td>number (or bigint in JavaScript)</td> <td>The ticks number</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>reformatted-timestamp</em>&gt;</td> <td>string</td> <td>The updated timestamp in the specified format</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example converts ticks to the specified format:</p> <pre><code>formatTicks(637243624200000000, 'yyyy-MM-ddTHH:mm:ss.fffZ') </code></pre> <p>And returns the result <strong>2020-05-06T11:47:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example converts ticks to the specified format in the <strong>de-DE</strong> locale:</p> <pre><code>formatTicks(637243624200000000, '', 'de-DE') </code></pre> <p>And returns the result <strong>06.05.20 11:47:00</strong>.</p> <p><a name="getFutureTime"></a></p> <h3 id="getfuturetime">getFutureTime</h3> <p>Return the current timestamp in an optional locale format plus the specified time units.</p> <pre><code>getFutureTime(&lt;interval&gt;, &lt;timeUnit&gt;, '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>interval</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The number of specific time units to add</td> </tr> <tr> <td>&lt;<em>timeUnit</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The unit of time to use with <em>interval</em>. Possible units are "Second", "Minute", "Hour", "Day", "Week", "Month", and "Year".</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The current timestamp plus the specified number of time units</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>Suppose the current timestamp is <strong>2019-03-01T00:00:00.000Z</strong>. The example below adds five days to that timestamp:</p> <pre><code>getFutureTime(2, 'Week') </code></pre> <p>And returns the result <strong>2019-03-15T00:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>Suppose the current timestamp is <strong>2018-03-01T00:00:00.000Z</strong>. The example below adds five days to the timestamp and converts the result to <strong>MM-DD-YY</strong> format:</p> <pre><code>getFutureTime(5, 'Day', 'MM-DD-YY') </code></pre> <p>And returns the result <strong>03-06-18</strong>.</p> <p><em>Example 3</em></p> <p>Suppose the current timestamp is <strong>2020-05-01T00:00:00.000Z</strong> and the locale is <strong>de-DE</strong>. The example below adds <strong>1</strong> day to the timestamp:</p> <pre><code>getFutureTime(1,'Day', '', 'de-DE') </code></pre> <p>And returns the result <strong>02.05.20 00:00:00</strong>.</p> <p><a name="getNextViableDate"></a></p> <h3 id="getnextviabledate">getNextViableDate</h3> <p>Return the next viable date of a Timex expression based on the current date and an optionally specified timezone.</p> <pre><code>getNextViableDate(&lt;timexString&gt;, &lt;timezone&gt;?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timexString</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The Timex string of the date to evaluate.</td> </tr> <tr> <td>&lt;<em>timezone</em>&gt;</td> <td>No</td> <td>string</td> <td>The optional timezone.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>nextViableTime</em>&gt;</td> <td>string</td> <td>The next viable date.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>Say the date is <strong>2020-06-12</strong> and current time is <strong>15:42:21</strong>.</p> <p>These examples evaluate the Timex string for the next viable date based on the above date and time:</p> <pre><code>getPreviousViableDate("XXXX-12-20", "America/Los_Angeles") getPreviousViableDate("XXXX-02-29") </code></pre> <p>And return the following strings respectively:</p> <ul> <li><strong>2020-12-20</strong></li> <li><strong>2024-02-29</strong></li> </ul> <p><a name="getNextViableTime"></a></p> <h3 id="getnextviabletime">getNextViableTime</h3> <p>Return the next viable time of a Timex expression based on the current time and an optionally specified timezone.</p> <pre><code>getNextViableTime(&lt;timexString&gt;, &lt;timezone&gt;?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timexString</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The Timex string of the time to evaluate.</td> </tr> <tr> <td>&lt;<em>timezone</em>&gt;</td> <td>No</td> <td>string</td> <td>The optional timezone.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>nextViableTime</em>&gt;</td> <td>string</td> <td>The next viable time.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>Say the date is <strong>2020-06-12</strong> and current time is <strong>15:42:21</strong>.</p> <p>These examples evaluate a Timex string for the next viable time based on the above date and time:</p> <pre><code>getNextViableTime("TXX:12:14", "Asia/Tokyo") getNextViableTime("TXX:52:14") </code></pre> <p>And return the following strings respectively:</p> <ul> <li><strong>T16:12:14</strong></li> <li><strong>T15:52:14</strong></li> </ul> <p><a name="getPastTime"></a></p> <h3 id="getpasttime">getPastTime</h3> <p>Return the current timestamp minus the specified time units.</p> <pre><code>getPastTime(&lt;interval&gt;, &lt;timeUnit&gt;, '&lt;format&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>interval</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The number of specific time units to subtract</td> </tr> <tr> <td>&lt;<em>timeUnit</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The unit of time to use with <em>interval</em>. Possible units are "Second", "Minute", "Hour", "Day", "Week", "Month", and "Year".</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The current timestamp minus the specified number of time units</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>Suppose the current timestamp is <strong>2018-02-01T00:00:00.000Z</strong>. This example subtracts five days from that timestamp:</p> <pre><code>getPastTime(5, 'Day') </code></pre> <p>And returns the result <strong>2019-01-27T00:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>Suppose the current timestamp is <strong>2018-03-01T00:00:00.000Z</strong>. This example subtracts five days to the timestamp in the <strong>MM-DD-YY</strong> format:</p> <pre><code>getPastTime(5, 'Day', 'MM-DD-YY') </code></pre> <p>And returns the result <strong>02-26-18</strong>.</p> <p><em>Example 3</em></p> <p>Suppose the current timestamp is <strong>2020-05-01T00:00:00.000Z</strong> and the locale is <strong>de-DE</strong>. The example below subtracts <strong>1</strong> day from the timestamp:</p> <pre><code>getPastTime(1,'Day', '', 'de-DE') </code></pre> <p>And returns the result <strong>31.04.20 00:00:00</strong>.</p> <p><a name="getPreviousViableDate"></a></p> <h3 id="getpreviousviabledate">getPreviousViableDate</h3> <p>Return the previous viable date of a Timex expression based on the current date and an optionally specified timezone.</p> <pre><code>getPreviousViableDate(&lt;timexString&gt;, &lt;timezone&gt;?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timexString</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The Timex string of the date to evaluate.</td> </tr> <tr> <td>&lt;<em>timezone</em>&gt;</td> <td>No</td> <td>string</td> <td>The optional timezone.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>previousViableDate</em>&gt;</td> <td>string</td> <td>The previous viable date.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>Say the date is <strong>2020-06-12</strong> and current time is <strong>15:42:21</strong>.</p> <p>These examples evaluate a Timex string for the previous viable date based on the above date and time:</p> <pre><code>getPreviousViableDate("XXXX-12-20", "Eastern Standard Time") getPreviousViableDate("XXXX-02-29") </code></pre> <p>And return the following strings respectively:</p> <ul> <li><strong>2019-12-20</strong></li> <li><strong>2020-02-29</strong></li> </ul> <p><a name="getPreviousViableTime"></a></p> <h3 id="getpreviousviabletime">getPreviousViableTime</h3> <p>Return the previous viable time of a Timex expression based on the current date and an optionally specified timezone.</p> <pre><code>getPreviousViableTime(&lt;timexString&gt;, &lt;timezone&gt;?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timexString</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The Timex string of the time to evaluate.</td> </tr> <tr> <td>&lt;<em>timezone</em>&gt;</td> <td>No</td> <td>string</td> <td>The optional timezone.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>previousViableTime</em>&gt;</td> <td>string</td> <td>The previous viable time.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>Say the date is <strong>2020-06-12</strong> and current time is <strong>15:42:21</strong>.</p> <p>These examples evaluate a Timex string for the previous viable time based on the above date and time:</p> <pre><code>getPreviousViableTime("TXX:52:14") getPreviousViableTime("TXX:12:14", 'Europe/London') </code></pre> <p>And return the following strings respectively:</p> <ul> <li><strong>T14:52:14</strong></li> <li><strong>T15:12:14</strong></li> </ul> <p><a name="getProperty"></a></p> <h3 id="getproperty">getProperty</h3> <p>Return the value of a specified property or the root property from a JSON object.</p> <h4 id="return-the-value-of-a-specified-property">Return the value of a specified property</h4> <pre><code>getProperty(&lt;JSONObject&gt;, '&lt;propertyName&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>JSONObject</em>&gt;</td> <td>Yes</td> <td>object</td> <td>The JSON object containing the property and values.</td> </tr> <tr> <td>&lt;<em>propertyName</em>&gt;</td> <td>No</td> <td>string</td> <td>The name of the optional property to access values from.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>value</td> <td>string</td> <td>The value of the specified property in the JSON object.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>Say you have the following JSON object:</p> <pre><code class="lang-json">{ "a:b" : "a:b value", "c": { "d": "d key" } } </code></pre> <p>These example retrieve a specified property from the above JSON object:</p> <pre><code>getProperty({"a:b": "value"}, 'a:b') getProperty(c, 'd') </code></pre> <p>And return the following strings respectively:</p> <ul> <li><strong>a:b value</strong></li> <li><strong>d key</strong></li> </ul> <h4 id="return-the-root-property">Return the root property</h4> <pre><code>getProperty('&lt;propertyName&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>propertyName</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The name of the optional property to access values from the root memory scope.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>value</td> <td>string</td> <td>The value of the root property in a JSON object.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>Say you have the following JSON object:</p> <pre><code class="lang-json">{ "a:b" : "a:b value", "c": { "d": "d key" } } </code></pre> <p>This example retrieves the root property from the above JSON object:</p> <pre><code>getProperty("a:b") </code></pre> <p>And returns the string <strong>a:b value</strong>.</p> <p><a name="getTimeOfDay"></a></p> <h3 id="gettimeofday">getTimeOfDay</h3> <p>Returns time of day for a given timestamp.</p> <pre><code>getTimeOfDay('&lt;timestamp&gt;') </code></pre> <p>Time returned is one of the following strings:</p> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the specified timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>time-of-day</em>&gt;</td> <td>string</td> <td>The time of day for the specified timestamp</td> </tr> </tbody> </table> <p>Listed below are the strings associated with the time of day:</p> <table> <thead> <tr> <th>Time of day</th> <th>Timestamp</th> </tr> </thead> <tbody> <tr> <td>midnight</td> <td>12AM</td> </tr> <tr> <td>morning</td> <td>12:01AM – 11:59PM</td> </tr> <tr> <td>afternoon</td> <td>12PM</td> </tr> <tr> <td>evening</td> <td>06:00PM – 10:00PM</td> </tr> <tr> <td>night</td> <td>10:01PM – 11:59PM</td> </tr> </tbody> </table> <p><em>Example</em></p> <pre><code>getTimeOfDay('2018-03-15T08:00:00.000Z') </code></pre> <p>Returns the result <strong>morning</strong>.</p> <p><a name="greater"></a></p> <h3 id="greater">greater</h3> <p>Check whether the first value is greater than the second value. Return <code>true</code> if the first value is more, or return <code>false</code> if less.</p> <pre><code>greater(&lt;value&gt;, &lt;compareTo&gt;) greater('&lt;value&gt;', '&lt;compareTo&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>integer, float, or string</td> <td>The first value to check whether greater than the second value</td> </tr> <tr> <td>&lt;<em>compareTo</em>&gt;</td> <td>Yes</td> <td>integer, float, or string, respectively</td> <td>The comparison value</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if the first value is greater than the second value. Return <code>false</code> if the first value is equal to or less than the second value.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples check whether the first value is greater than the second value:</p> <pre><code>greater(10, 5) greater('apple', 'banana') </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> <p><a name="greaterOrEquals"></a></p> <h3 id="greaterorequals">greaterOrEquals</h3> <p>Check whether the first value is greater than or equal to the second value. Return <code>true</code> when the first value is greater or equal, or return <code>false</code> if the first value is less.</p> <pre><code>greaterOrEquals(&lt;value&gt;, &lt;compareTo&gt;) greaterOrEquals('&lt;value&gt;', '&lt;compareTo&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>integer, float, or string</td> <td>The first value to check whether greater than or equal to the second value</td> </tr> <tr> <td>&lt;<em>compareTo</em>&gt;</td> <td>Yes</td> <td>integer, float, or string, respectively</td> <td>The comparison value</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if the first value is greater than or equal to the second value. Return <code>false</code> if the first value is less than the second value.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples check whether the first value is greater or equal than the second value:</p> <pre><code>greaterOrEquals(5, 5) greaterOrEquals('apple', 'banana') </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> <p><a name="if"></a></p> <h3 id="if">if</h3> <p>Check whether an expression is true or false. Based on the result, return a specified value.</p> <pre><code>if(&lt;expression&gt;, &lt;valueIfTrue&gt;, &lt;valueIfFalse&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>expression</em>&gt;</td> <td>Yes</td> <td>Boolean</td> <td>The expression to check</td> </tr> <tr> <td>&lt;<em>valueIfTrue</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The value to return if the expression is true</td> </tr> <tr> <td>&lt;<em>valueIfFalse</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The value to return if the expression is false</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>specified-return-value</em>&gt;</td> <td>any</td> <td>The specified value that returns based on whether the expression is <code>true</code> or <code>false</code></td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example evaluates whether <code>equals(1,1)</code> is true:</p> <pre><code>if(equals(1, 1), 'yes', 'no') </code></pre> <p>And returns <strong>yes</strong> because the specified expression returns <code>true</code>. Otherwise, the example returns <strong>no</strong>.</p> <p><a name="indexOf"></a></p> <h3 id="indexof">indexOf</h3> <p>Return the starting position or index value of a substring. This function is case-insensitive, and indexes start with the number 0.</p> <pre><code>indexOf('&lt;text&gt;', '&lt;searchText&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The string that has the substring to find</td> </tr> <tr> <td>&lt;<em>searchText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The substring to find</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>index-value</em>&gt;</td> <td>integer</td> <td>The starting position or index value of the specified substring.</td> </tr> <tr> <td>If the string isn't found, return the number -1.</td> <td></td> <td></td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example finds the starting index value of the substring <strong>world</strong> in the string <strong>hello world</strong>:</p> <pre><code>indexOf('hello world', 'world') </code></pre> <p>And returns the result <strong>6</strong>.</p> <p><em>Example 2</em></p> <p>This example finds the starting index value of the substring <strong>def</strong> in the array <strong>['abc', 'def', 'ghi']</strong>:</p> <pre><code>indexOf(createArray('abc', 'def', 'ghi'), 'def') </code></pre> <p>And returns the result <strong>1</strong>.</p> <p><a name="indicesAndValues"></a></p> <h3 id="indicesandvalues">indicesAndValues</h3> <p>Turn an array or object into an array of objects with index (current index) and value properties. For arrays, the index is the position in the array. For objects, it's the key for the value.</p> <pre><code>indicesAndValues('&lt;collection or object&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection or object</em>&gt;</td> <td>Yes</td> <td>array or object</td> <td>Original array or object</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>array</td> <td>New array. Each item has two properties: the index with the position in an array or the key for an object, and the corresponding value.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>Say you have a list <strong>{ items: ["zero", "one", "two"] }</strong>. The following function takes that list:</p> <pre><code>indicesAndValues(items) </code></pre> <p>And returns a new list:</p> <pre><code>[ { index: 0, value: 'zero' }, { index: 1, value: 'one' }, { index: 2, value: 'two' } ] </code></pre> <p><em>Example 2</em></p> <p>Say you have a list <strong>{ items: ["zero", "one", "two"] }</strong>. The following function takes that list:</p> <pre><code>where(indicesAndValues(items), elt, elt.index &gt;= 1) </code></pre> <p>And returns a new list:</p> <pre><code>[ { index: 1, value: 'one' }, { index: 2, value: 'two' } ] </code></pre> <p><em>Example 3</em></p> <p>Say you have a list <strong>{ items: ["zero", "one", "two"] }</strong>. The following function takes that list:</p> <pre><code>join(foreach(indicesAndValues(items), item, item.value), ',') </code></pre> <p>And returns the result <strong>zero,one,two</strong>. This expression has the same effect as <a href="#join" data-linktype="self-bookmark">join(items, ',')</a>.</p> <p><em>Example 4</em></p> <p>Say you have an object <strong>{ user: {name: 'jack', age: 20} }</strong>. The following function takes that object:</p> <pre><code>indicesAndValues(user) </code></pre> <p>And returns a new object:</p> <pre><code>[ { index: 'name', value: 'jack' }, { index: 'age', value: 20 } ] </code></pre> <p><a name="int"></a></p> <h3 id="int">int</h3> <p>Return the integer version of a string. An exception will be thrown if the string can't be converted to an integer.</p> <pre><code>int('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>integer-result</em>&gt;</td> <td>integer</td> <td>The integer version of the specified string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates an integer version for the string <strong>10</strong>:</p> <pre><code>int('10') </code></pre> <p>And returns the result as the integer <strong>10</strong>.</p> <p><a name="intersection"></a></p> <h3 id="intersection">intersection</h3> <p>Return a collection that has only the common items across the specified collections. To appear in the result, an item must appear in all the collections passed to this function. If one or more items have the same name, the last item with that name appears in the result.</p> <pre><code>intersection([&lt;collection1&gt;], [&lt;collection2&gt;], ...) intersection('&lt;collection1&gt;', '&lt;collection2&gt;', ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection1</em>&gt;, &lt;<em>collection2</em>&gt;</td> <td>Yes</td> <td>array or object, but not both</td> <td>The collections from which you want only the common items</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>common-items</em>&gt;</td> <td>array or object, respectively</td> <td>A collection that has only the common items across the specified collections</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the common items across the following arrays:</p> <pre><code>intersection(createArray(1, 2, 3), createArray(101, 2, 1, 10), createArray(6, 8, 1, 2)) </code></pre> <p>And returns an array with only the items <strong>[1, 2]</strong>.</p> <p><a name="isArray"></a></p> <h3 id="isarray">isArray</h3> <p>Return <code>true</code> if a given input is an array.</p> <pre><code>isArray('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The input to be tested</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if a given input is an array, or return <code>false</code> if it's not an array.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the input is an array:</p> <pre><code>isArray('hello') isArray(createArray('hello', 'world')) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The input is a string, so the function returns <code>false</code>.</li> <li>The input is an array, so the function returns <code>true</code>.</li> </ul> <p><a name="isBoolean"></a></p> <h3 id="isboolean">isBoolean</h3> <p>Return <code>true</code> if a given input is a Boolean.</p> <pre><code>isBoolean('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The input to be tested</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if a given input is a Boolean, or return <code>false</code> if it not a Boolean.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the input is a Boolean:</p> <pre><code>isBoolean('hello') isBoolean(32 &gt; 16) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The input is a string, so the function returns <code>false</code>.</li> <li>The input is a Boolean, so the function returns <code>true</code>. <a name="isDate"></a></li> </ul> <h3 id="isdate">isDate</h3> <p>Return <code>true</code> if a given TimexProperty or Timex expression refers to a valid date. Valid dates contain the month and dayOfMonth, or contain the dayOfWeek.</p> <pre><code>isDate('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>object or string</td> <td>The input TimexProperty object or a Timex expression string.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if the input refers to a valid date, or return <code>false</code> if the date is invalid.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples check if the following inputs are valid dates:</p> <pre><code>isDate('2020-12') isDate('xxxx-12-21') </code></pre> <p>And return the following results:</p> <ul> <li><code>false</code></li> <li><code>true</code></li> </ul> <p><a name="isDateRange"></a></p> <h3 id="isdaterange">isDateRange</h3> <p>Return <code>true</code> if a given TimexProperty or Timex expression refers to a valid date range.</p> <pre><code>isDateRange('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>object or string</td> <td>The input TimexProperty object a Timex expression string.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if given input refers to a valid date range, or return <code>false</code> if it's not a valid date range.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples check if the following input is a valid date range:</p> <pre><code>isDateRange('PT30M') isDateRange('2012-02') </code></pre> <p>And return the following results:</p> <ul> <li><code>false</code></li> <li><code>true</code></li> </ul> <p><a name="isDateTime"></a></p> <h3 id="isdatetime">isDateTime</h3> <p>Return <code>true</code> if a given input is a UTC ISO format (<strong>YYYY-MM-DDTHH:mm:ss.fffZ</strong>) timestamp string.</p> <pre><code>isDateTime('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The input to be tested</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if a given input is a UTC ISO format timestamp string, or return <code>false</code> if it's not a UTC ISO format timestamp string.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the input is a UTC ISO format string:</p> <pre><code>isDateTime('hello world!') isDateTime('2019-03-01T00:00:00.000Z') </code></pre> <p>And return the following results respectively:</p> <ul> <li>The input is a string, so the function returns <code>false</code>.</li> <li>The input is a UTC ISO format string, so the function returns <code>true</code>.</li> </ul> <p><a name="isDefinite"></a></p> <h3 id="isdefinite">isDefinite</h3> <p>Return <code>true</code> if a given TimexProperty or Timex expression refers to a valid date. Valid dates contain the year, month and dayOfMonth.</p> <pre><code>isDefinite('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>object or string</td> <td>The input TimexProperty object a Timex expression string.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if the given input refers to a valid full date, or return <code>false</code> if it doesn't refer to a valid full date.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>Suppose there is a TimexProperty object <strong>validFullDate = new TimexProperty("2020-02-20")</strong> and the <code>Now</code> property is set to <code>true</code>. The following examples check if the object refers a valid full date:</p> <pre><code>isDefinite('xxxx-12-21') isDefinite(validFullDate) </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>false</code></li> <li><code>true</code></li> </ul> <p><a name="isDuration"></a></p> <h3 id="isduration">isDuration</h3> <p>Return <code>true</code> if a given TimexProperty or Timex expression refers to a valid duration.</p> <pre><code>isDuration('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>object or string</td> <td>The input TimexProperty object a Timex expression string.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if the input refers to a valid duration, or return <code>false</code> if the input doesn't refer to a valid duration.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The examples below check if the following input refers to a valid duration:</p> <pre><code>isDuration('PT30M') isDuration('2012-02') </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> <p><a name="isFloat"></a></p> <h3 id="isfloat">isFloat</h3> <p>Return <code>true</code> if a given input is a floating-point number. Due to the alignment between C#and JavaScript, a number with an non-zero residue of its modulo 1 will be treated as a floating-point number.</p> <pre><code>isFloat('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The input to be tested</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if a given input is a floating-point number, or return <code>false</code> if the input isn't a floating-point number.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the input is a floating-point number:</p> <pre><code>isFloat('hello world!') isFloat(1.0) isFloat(12.01) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The input is a string, so the function returns <code>false</code>.</li> <li>The input has a modulo that equals 0, so the function returns <code>false</code>.</li> <li>The input is a floating-point number, so the function returns <code>true</code>.</li> </ul> <p><a name="isInteger"></a></p> <h3 id="isinteger">isInteger</h3> <p>Return <code>true</code> if a given input is an integer number. Due to the alignment between C# and JavaScript, a number with an zero residue of its modulo 1 will be treated as an integer number.</p> <pre><code>isInteger('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The input to be tested</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Is the input is an integer number</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the input is an integer:</p> <pre><code>isInteger('hello world!') isInteger(1.0) isInteger(12) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The input is a string, so the function returns <code>false</code>.</li> <li>The input has a modulo that equals 0, so the function returns <code>true</code>.</li> <li>The input is an integer, so the function returns <code>true</code>.</li> </ul> <p><a name="isMatch"></a></p> <h3 id="ismatch">isMatch</h3> <p>Return <code>true</code> if a given string is matches a specified regular expression pattern.</p> <pre><code>isMatch('&lt;target**string&gt;', '&lt;pattern&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>target**string</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to be matched</td> </tr> <tr> <td>&lt;<em>pattern</em>&gt;</td> <td>Yes</td> <td>string</td> <td>A regular expression pattern</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if a given string is matches a common regular expression pattern, or return <code>false</code> if it doesn't match the pattern.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the input matches the specified regular expression pattern:</p> <pre><code>isMatch('ab', '^[a-z]{1,2}$') isMatch('FUTURE', '(?i)fortune|future') isMatch('12abc34', '([0-9]+)([a-z]+)([0-9]+)') isMatch('abacaxc', 'ab.*?c') </code></pre> <p>And return the same result <code>true</code>.</p> <p><a name="isObject"></a></p> <h3 id="isobject">isObject</h3> <p>Return <code>true</code> if a given input is a complex object or return <code>false</code> if it's a primitive object. Primitive objects include strings, numbers, and Booleans; complex types, like classes, contain properties.</p> <pre><code>isObject('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The input to be tested</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if a given input is a complex object, or return <code>false</code> if it's a primitive object.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the given input is an object:</p> <pre><code>isObject('hello world!') isObject({userName: "Sam"}) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The input is a string, so the function returns <code>false</code>.</li> <li>The input is an object, so the function returns <code>true</code>.</li> </ul> <p><a name="isPresent"></a></p> <h3 id="ispresent">isPresent</h3> <p>Return <code>true</code> if a given TimexProperty or Timex expression refers to the present.</p> <pre><code>isPresent('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>object or string</td> <td>The input TimexProperty object a Timex expression string</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if the input refers to the present, or return false if it doesn't refer to the present.</td> </tr> </tbody> </table> <p><em>Examples</em> Suppose we have an TimexProperty object <strong>validNow = new TimexProperty() { Now = true }</strong> and set the <code>Now</code> property to <code>true</code>. The examples below check if the following input refers to the present:</p> <pre><code>isPresent('PT30M') isPresent(validNow) </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>false</code></li> <li><code>true</code></li> </ul> <p><a name="isString"></a></p> <h3 id="isstring">isString</h3> <p>Return <code>true</code> if a given input is a string.</p> <pre><code>isString('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The input to be tested</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if a given input is a string, or return <code>false</code> if not a string.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>The following examples check if the given input is a string:</p> <pre><code>isString('hello world!') isString(3.14) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The input is a string, so the function returns <code>true</code>.</li> <li>The input is a float, so the function returns <code>false</code>.</li> </ul> <p><a name="isTime"></a></p> <h3 id="istime">isTime</h3> <p>Return <code>true</code> if a given TimexProperty or Timex expression refers to a valid time. Valid time contains hours, minutes and seconds.</p> <pre><code>isTime('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>object or string</td> <td>The input TimexProperty object a Timex expression string</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if the input refers to a valid time, or return <code>false</code> if it doesn't refer to a valid time..</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples check if the following input refers to a valid time:</p> <pre><code>isTime('PT30M') isTime('2012-02-21T12:30:45') </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>false</code></li> <li><code>true</code></li> </ul> <p><a name="isTimeRange"></a></p> <h3 id="istimerange">isTimeRange</h3> <p>Return <code>true</code> if a given TimexProperty or Timex expression refers to a valid time range Valid time ranges contain partOfDay.</p> <pre><code>isTime('&lt;input&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>input</em>&gt;</td> <td>Yes</td> <td>object or string</td> <td>The input TimexProperty object a Timex expression string.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>boolean-result</em>&gt;</td> <td>Boolean</td> <td>Return <code>true</code> if the input refers to a valid time range, or return <code>false</code> if it doesn't refer to a valid time range.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>Suppose we have an TimexProperty object <strong>validTimeRange = new TimexProperty() { PartOfDay = "morning" }</strong> and set the <code>Now</code> property to <code>true</code>. These examples check if the following inputs are valid time ranges:</p> <pre><code>isTimeRange('PT30M') isTimeRange(validTimeRange) </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>false</code></li> <li><code>true</code></li> </ul> <p><a name="join"></a></p> <h3 id="join">join</h3> <p>Return a string that has all the items from an array, with each character separated by a <em>delimiter</em>.</p> <pre><code>join([&lt;collection&gt;], '&lt;delimiter&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>array</td> <td>The array that has the items to join</td> </tr> <tr> <td>&lt;<em>delimiter</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The separator that appears between each character in the resulting string</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>char1</em>&gt;&lt;<em>delimiter</em>&gt;&lt;<em>char2</em>&gt;&lt;<em>delimiter</em>&gt;...</td> <td>string</td> <td>The resulting string created from all the items in the specified array</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates a string from all the items in this array with the specified character <strong>.</strong> as the delimiter:</p> <pre><code>join(createArray('a', 'b', 'c'), '.') </code></pre> <p>And returns the result <strong>a.b.c</strong>.</p> <p><a name="jPath"></a></p> <h3 id="jpath">jPath</h3> <p>Check JSON or a JSON string for nodes or values that match a path expression, and return the matching nodes.</p> <pre><code>jPath(&lt;json&gt;, '&lt;path&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>json</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The JSON object or string to search for nodes or values that match the path expression value</td> </tr> <tr> <td>&lt;<em>path</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The path expression used to find matching JSON nodes or values</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>[ &lt;<em>json-node</em>&gt;]</td> <td>array</td> <td>A list of JSON nodes or values that matches the specified path expression</td> </tr> </tbody> </table> <p><em>C# Example</em></p> <p>Say you have the following JSON:</p> <pre><code class="lang-json">{ "Stores": [ "Lambton Quay", "Willis Street" ], "Manufacturers": [ { "Name": "Acme Co", "Products": [ { "Name": "Anvil", "Price": 50 } ] }, { "Name": "Contoso", "Products": [ { "Name": "Elbow Grease", "Price": 99.95 }, { "Name": "Headlight Fluid", "Price": 4 } ] } ] } </code></pre> <p>The path expression is <strong>$..Products[?(@.Price &gt;= 50)].Name</strong></p> <pre><code>jPath(jsonStr, path) </code></pre> <p>And it returns the result <strong>["Anvil", "Elbow Grease"]</strong>.</p> <p><em>JavaScript Example</em></p> <p>Say you have the following JSON:</p> <pre><code class="lang-json">{ "automobiles": [ { "maker": "Nissan", "model": "Teana", "year": 2011 }, { "maker": "Honda", "model": "Jazz", "year": 2010 }, { "maker": "Honda", "model": "Civic", "year": 2007 }, { "maker": "Toyota", "model": "Yaris", "year": 2008 }, { "maker": "Honda", "model": "Accord", "year": 2011 } ], "motorcycles": [ { "maker": "Honda", "model": "ST1300", "year": 2012 } ] } </code></pre> <p>The path expression is <strong>.automobiles{.maker === "Honda" &amp;&amp; .year &gt; 2009}.model</strong>.</p> <pre><code>jPath(jsonStr, path) </code></pre> <p>And it returns the result <strong>['Jazz', 'Accord']</strong>.</p> <p><a name="json"></a></p> <h3 id="json">json</h3> <p>Return the JavaScript Object Notation (JSON) type value or object of a string or XML.</p> <pre><code>json('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string or XML</td> <td>The string or XML to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>JSON-result</em>&gt;</td> <td>string</td> <td>The resulting JSON object created from the specified string or XML.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example converts a string to JSON:</p> <pre><code>json('{"fullName": "Sophia Owen"}') </code></pre> <p>And returns the result:</p> <pre><code>{ "fullName": "Sophia Owen" } </code></pre> <p><em>Example 2</em></p> <p>This example converts XML to JSON:</p> <pre><code>json(xml('&lt;?xml version="1.0"?&gt; &lt;root&gt; &lt;person id='1'&gt; &lt;name&gt;Sophia Owen&lt;/name&gt; &lt;occupation&gt;Engineer&lt;/occupation&gt; &lt;/person&gt; &lt;/root&gt;')) </code></pre> <p>And returns the result:</p> <pre><code>{ "?xml": { "@version": "1.0" }, "root": { "person": [ { "@id": "1", "name": "Sophia Owen", "occupation": "Engineer" } ] } } </code></pre> <p><a name="jsonStringify"></a></p> <h3 id="jsonstringify">jsonStringify</h3> <p>Return the JSON string of a value.</p> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>object</td> <td>The object to convert to a JSON string</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>JSON-result</em>&gt;</td> <td>string</td> <td>The resulting JSON string.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples show objects converted to JSON strings:</p> <pre><code>jsonStringify(null) jsonStringify({a:'b'}) </code></pre> <p>And return the following string results respectively:</p> <ul> <li><strong>null</strong></li> <li><strong>{"a":"b"}</strong></li> </ul> <p><a name="last"></a></p> <h3 id="last">last</h3> <p>Return the last item from a collection.</p> <pre><code>last('&lt;collection&gt;') last([&lt;collection&gt;]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The collection in which to find the last item</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>last-collection-item</em>&gt;</td> <td>string or array, respectively</td> <td>The last item in the collection</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples find the last item in these collections:</p> <pre><code>last('abcd') last(createArray(0, 1, 2, 3)) </code></pre> <p>And returns the following results respectively:</p> <ul> <li><strong>d</strong></li> <li><strong>3</strong></li> </ul> <p><a name="lastIndexOf"></a></p> <h3 id="lastindexof">lastIndexOf</h3> <p>Return the starting position or index value of the last occurrence of a substring. This function is case-insensitive, and indexes start with the number 0.</p> <pre><code>lastIndexOf('&lt;text&gt;', '&lt;searchText&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The string that has the substring to find</td> </tr> <tr> <td>&lt;<em>searchText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The substring to find</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>ending-index-value</em>&gt;</td> <td>integer</td> <td>The starting position or index value of the last occurrence of the specified substring. If the string isn't found, return the number <strong>-1</strong>.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example finds the starting index value of the last occurrence of the substring <strong>world</strong> in the <strong>hello world</strong> string:</p> <pre><code>lastIndexOf('hello world', 'world') </code></pre> <p>And returns the result <strong>6</strong>.</p> <p><em>Example 2</em></p> <p>This example finds the starting index value of the last occurrence of substring <strong>def</strong> in the array <strong>['abc', 'def', 'ghi', 'def']</strong>.</p> <pre><code>lastIndexOf(createArray('abc', 'def', 'ghi', 'def'), 'def') </code></pre> <p>And returns the result <strong>3</strong>.</p> <h3 id="length">length</h3> <p>Return the length of a string.</p> <pre><code>length('&lt;str&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>str</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to calculate for length</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>length</em>&gt;</td> <td>integer</td> <td>The length of this string</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples get the length of strings:</p> <pre><code>length('hello') length('hello world') </code></pre> <p>And returns the following results respectively:</p> <ul> <li><strong>5</strong></li> <li><strong>11</strong></li> </ul> <p><a name="less"></a></p> <h3 id="less">less</h3> <p>Check whether the first value is less than the second value. Return <code>true</code> if the first value is less, or return <code>false</code> if the first value is more.</p> <pre><code>less(&lt;value&gt;, &lt;compareTo&gt;) less('&lt;value&gt;', '&lt;compareTo&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>integer, float, or string</td> <td>The first value to check whether less than the second value</td> </tr> <tr> <td>&lt;<em>compareTo</em>&gt;</td> <td>Yes</td> <td>integer, float, or string, respectively</td> <td>The comparison item</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if the first value is less than the second value. Return <code>false</code> if the first value is equal to or greater than the second value.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples check whether the first value is less than the second value.</p> <pre><code>less(5, 10) less('banana', 'apple') </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> <p><a name="lessOrEquals"></a></p> <h3 id="lessorequals">lessOrEquals</h3> <p>Check whether the first value is less than or equal to the second value. Return <code>true</code> if the first value is less than or equal, or return <code>false</code> if the first value is more.</p> <pre><code>lessOrEquals(&lt;value&gt;, &lt;compareTo&gt;) lessOrEquals('&lt;value&gt;', '&lt;compareTo&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>integer, float, or string</td> <td>The first value to check whether less than or equal to the second value</td> </tr> <tr> <td>&lt;<em>compareTo</em>&gt;</td> <td>Yes</td> <td>integer, float, or string, respectively</td> <td>The comparison item</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if the first value is less than or equal to the second value. Return <code>false</code> if the first value is greater than the second value.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples check whether the first value is less than or equal to the second value.</p> <pre><code>lessOrEquals(10, 10) lessOrEquals('apply', 'apple') </code></pre> <p>And return the following results respectively:</p> <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> <p><a name="max"></a></p> <h3 id="max">max</h3> <p>Return the highest value from a list or array. The list or array is inclusive at both ends.</p> <pre><code>max(&lt;number1&gt;, &lt;number2&gt;, ...) max([&lt;number1&gt;, &lt;number2&gt;, ...]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number1</em>&gt;, &lt;<em>number2</em>&gt;, ...</td> <td>Yes</td> <td>number</td> <td>The set of numbers from which you want the highest value</td> </tr> <tr> <td>[&lt;<em>number1</em>&gt;, &lt;<em>number2</em>&gt;, ...]</td> <td>Yes</td> <td>array of numbers</td> <td>The array of numbers from which you want the highest value</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>max-value</em>&gt;</td> <td>number</td> <td>The highest value in the specified array or set of numbers</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples get the highest value from the set of numbers and the array:</p> <pre><code>max(1, 2, 3) max(createArray(1, 2, 3)) </code></pre> <p>And return the result <strong>3</strong>.</p> <p><a name="merge"></a></p> <h3 id="merge">merge</h3> <p>Merges multiple JSON objects or an array of objects together.</p> <pre><code>merge(&lt;json1&gt;, &lt;json2&gt;, ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>json1</em>&gt;, &lt;<em>json2</em>&gt;, ...</td> <td>Yes</td> <td>objects or array</td> <td>The set of JSON objects or array to merge together.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result</em>&gt;</td> <td>object</td> <td>The combined JSON object or combined array objects.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>Say you have the following JSON objects:</p> <pre><code class="lang-json">json1 = @"{ 'FirstName': 'John', 'LastName': 'Smith', 'Enabled': false, 'Roles': [ 'User' ] }" json2 =@"{ 'Enabled': true, 'Roles': [ 'User', 'Admin' ] }" </code></pre> <p>This example merges the JSON objects:</p> <pre><code>string(merge(json(json1), json(json2))) </code></pre> <p>And returns the resulting object <strong>{"FirstName":"John","LastName":"Smith","Enabled":true,"Roles":["User","Admin"]}</strong>.</p> <p>Say you want to combine objects and a list of objects together. The following example combines JSON object and an array of objects:</p> <pre><code>merge({k1:'v1'}, [{k2:'v2'}, {k3: 'v3'}], {k4:'v4'}) </code></pre> <p>And returns the object <strong>{ "k1": "v1", "k2": "v2", "k3": "v3", "k4": "v4" }</strong>.</p> <p><a name="min"></a></p> <h3 id="min">min</h3> <p>Return the lowest value from a set of numbers or an array.</p> <pre><code>min(&lt;number1&gt;, &lt;number2&gt;, ...) min([&lt;number1&gt;, &lt;number2&gt;, ...]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number1</em>&gt;, &lt;<em>number2</em>&gt;, ...</td> <td>Yes</td> <td>number</td> <td>The set of numbers from which you want the lowest value</td> </tr> <tr> <td>[&lt;<em>number1</em>&gt;, &lt;<em>number2</em>&gt;, ...]</td> <td>Yes</td> <td>array of numbers</td> <td>The array of numbers from which you want the lowest value</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>min-value</em>&gt;</td> <td>number</td> <td>The lowest value in the specified array or set of numbers</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples get the lowest value in the set of numbers and the array:</p> <pre><code>min(1, 2, 3) min(createArray(1, 2, 3)) </code></pre> <p>And return the result <strong>1</strong>.</p> <p><a name="mod"></a></p> <h3 id="mod">mod</h3> <p>Return the remainder from dividing two numbers. To get the integer result, see <a href="#div" data-linktype="self-bookmark">div()</a>.</p> <pre><code>mod(&lt;dividend&gt;, &lt;divisor&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>dividend</em>&gt;</td> <td>Yes</td> <td>number</td> <td>The number to divide by the <em>divisor</em></td> </tr> <tr> <td>&lt;<em>divisor</em>&gt;</td> <td>Yes</td> <td>number</td> <td>The number that divides the <em>dividend</em>. Can't be 0.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>modulo-result</em>&gt;</td> <td>number</td> <td>The remainder from dividing the first number by the second number</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example divides the first number by the second number:</p> <pre><code>mod(3, 2) </code></pre> <p>And returns the result <strong>1</strong>.</p> <p><a name="month"></a></p> <h3 id="month">month</h3> <p>Return the month of the specified timestamp.</p> <pre><code>month('&lt;timestamp&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number-of-month</em>&gt;</td> <td>integer</td> <td>The number of the month in the specified timestamp</td> </tr> </tbody> </table> <p><em>Example</em></p> <pre><code>month('2018-03-15T13:01:00.000Z') </code></pre> <p>And it returns the result <strong>3</strong>.</p> <p><a name="mul"></a></p> <h3 id="mul">mul</h3> <p>Return the product from multiplying two numbers.</p> <pre><code>mul(&lt;multiplicand1&gt;, &lt;multiplicand2&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>multiplicand1</em>&gt;</td> <td>Yes</td> <td>integer or float</td> <td>The number to multiply by <em>multiplicand2</em></td> </tr> <tr> <td>&lt;<em>multiplicand2</em>&gt;</td> <td>Yes</td> <td>integer or float</td> <td>The number that multiples <em>multiplicand1</em></td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>product-result</em>&gt;</td> <td>integer or float</td> <td>The product from multiplying the first number by the second number</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples multiple the first number by the second number:</p> <pre><code>mul(1, 2) mul(1.5, 2) </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>2</strong></li> <li><strong>3</strong></li> </ul> <p><a name="newGuid"></a></p> <h3 id="newguid">newGuid</h3> <p>Return a new Guid string.</p> <pre><code>newGuid() </code></pre> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Guid-string</em>&gt;</td> <td>string</td> <td>A new Guid string, length is 36 and looks like <em>xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx</em></td> </tr> </tbody> </table> <p><em>Example</em></p> <pre><code>newGuid() </code></pre> <p>And it returns a result which follows the format <strong>xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx</strong>.</p> <p><a name="not"></a></p> <h3 id="not">not</h3> <p>Check whether an expression is false. Return <code>true</code> if the expression is false, or return <code>false</code> if true.</p> <pre><code>not(&lt;expression&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>expression</em>&gt;</td> <td>Yes</td> <td>Boolean</td> <td>The expression to check</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if the expression is false. Return <code>false</code> if the expression is true.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>These examples check whether the specified expressions are false:</p> <pre><code>not(false) not(true) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The expression is false, so the function returns <code>true</code>.</li> <li>The expression is true, so the function returns <code>false</code>.</li> </ul> <p><em>Example 2</em></p> <p>These examples check whether the specified expressions are false:</p> <pre><code>not(equals(1, 2)) not(equals(1, 1)) </code></pre> <p>And return the following results respectively:</p> <ul> <li>The expression is false, so the function returns <code>true</code>.</li> <li>The expression is true, so the function returns <code>false</code>.</li> </ul> <p><a name="or"></a></p> <h3 id="or">or</h3> <p>Check whether at least one expression is true. Return <code>true</code> if at least one expression is true, or return <code>false</code> if all are false.</p> <pre><code>or(&lt;expression1&gt;, &lt;expression2&gt;, ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>expression1</em>&gt;, &lt;<em>expression2</em>&gt;, ...</td> <td>Yes</td> <td>Boolean</td> <td>The expressions to check</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if at least one expression is true. Return <code>false</code> if all expressions are false.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>These examples check whether at least one expression is true:</p> <pre><code>or(true, false) or(false, false) </code></pre> <p>And return the following results respectively:</p> <ul> <li>At least one expression is true, so the function returns <code>true</code>.</li> <li>Both expressions are false, so the function returns <code>false</code>.</li> </ul> <p><em>Example 2</em></p> <p>These examples check whether at least one expression is true:</p> <pre><code>or(equals(1, 1), equals(1, 2)) or(equals(1, 2), equals(1, 3)) </code></pre> <p>And return the following results respectively:</p> <ul> <li>At least one expression is true, so the function returns <code>true</code>.</li> <li>Both expressions are false, so the function returns <code>false</code>.</li> </ul> <p><a name="rand"></a></p> <h3 id="rand">rand</h3> <p>Return a random integer from a specified range, which is inclusive only at the starting end.</p> <pre><code>rand(&lt;minValue&gt;, &lt;maxValue&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>minValue</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The lowest integer in the range</td> </tr> <tr> <td>&lt;<em>maxValue</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The integer that follows the highest integer in the range that the function can return</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>random-result</em>&gt;</td> <td>integer</td> <td>The random integer returned from the specified range</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example gets a random integer from the specified range, excluding the maximum value:</p> <pre><code>rand(1, 5) </code></pre> <p>And returns <strong>1</strong>, <strong>2</strong>, <strong>3</strong>, or <strong>4</strong> as the result.</p> <p><a name="range"></a></p> <h3 id="range">range</h3> <p>Return an integer array that starts from a specified integer.</p> <pre><code>range(&lt;startIndex&gt;, &lt;count&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>startIndex</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>An integer value that starts the array as the first item</td> </tr> <tr> <td>&lt;<em>count</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The number of integers in the array</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>range-result</em>&gt;</td> <td>integer</td> <td>The array with integers starting from the specified index</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates an integer array that starts from the specified index <strong>1</strong> and has the specified number of integers as <strong>4</strong>:</p> <pre><code>range(1, 4) </code></pre> <p>And returns the result <strong>[1, 2, 3, 4]</strong>.</p> <p><a name="removeProperty"></a></p> <h3 id="removeproperty">removeProperty</h3> <p>Remove a property from an object and return the updated object.</p> <pre><code>removeProperty(&lt;object&gt;, '&lt;property&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object</em>&gt;</td> <td>Yes</td> <td>object</td> <td>The JSON object in which you want to remove a property</td> </tr> <tr> <td>&lt;<em>property</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The name of the property to remove</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-object</em>&gt;</td> <td>object</td> <td>The updated JSON object without the specified property</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example removes the <code>accountLocation</code> property from a <code>customerProfile</code> object, which is converted to JSON with the <a href="#json" data-linktype="self-bookmark">json()</a> function, and returns the updated object:</p> <pre><code>removeProperty(json('customerProfile'), 'accountLocation') </code></pre> <p><a name="replace"></a></p> <h3 id="replace">replace</h3> <p>Replace a substring with the specified string, and return the result string. This function is case-sensitive.</p> <pre><code>replace('&lt;text&gt;', '&lt;oldText&gt;', '&lt;newText&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that has the substring to replace</td> </tr> <tr> <td>&lt;<em>oldText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The substring to replace</td> </tr> <tr> <td>&lt;<em>newText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The replacement string</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-text</em>&gt;</td> <td>string</td> <td>The updated string after replacing the substring. If the substring isn't found, the function returns the original string.</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example finds the substring <strong>old</strong> in <strong>the old string</strong> and replaces <strong>old</strong> with <strong>new</strong>:</p> <pre><code>replace('the old string', 'old', 'new') </code></pre> <p>The result is the string <strong>the new string</strong>.</p> <p><em>Example 2</em></p> <p>When dealing with escape characters, the expression engine handles the unescape for you. This function replaces strings with escape characters.</p> <pre><code>replace('hello\"', '\"', '\n') replace('hello\n', '\n', '\\\\') @"replace('hello\\', '\\', '\\\\')" @"replace('hello\n', '\n', '\\\\')" </code></pre> <p>And returns the following results respectively:</p> <ul> <li><strong>hello\n</strong></li> <li><strong>hello\\</strong></li> <li><strong>@"hello\\"</strong></li> <li><strong>@"hello\\"</strong></li> </ul> <p><a name="replaceIgnoreCase"></a></p> <h3 id="replaceignorecase">replaceIgnoreCase</h3> <p>Replace a substring with the specified string, and return the result string. This function is case-insensitive.</p> <pre><code>replaceIgnoreCase('&lt;text&gt;', '&lt;oldText&gt;', '&lt;newText&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that has the substring to replace</td> </tr> <tr> <td>&lt;<em>oldText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The substring to replace</td> </tr> <tr> <td>&lt;<em>newText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The replacement string</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-text</em>&gt;</td> <td>string</td> <td>The updated string after replacing the substring. If the substring isn't found, return the original string.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the substring <strong>old</strong> in the string <strong>the old string</strong> and replaces <strong>old</strong> with <strong>new</strong>:</p> <pre><code>replace('the old string', 'old', 'new') </code></pre> <p>And returns the result <strong>the new string</strong>.</p> <p><a name="resolve"></a></p> <h3 id="resolve">resolve</h3> <p>Return string of a given TimexProperty or Timex expression if it refers to a valid time. Valid time contains hours, minutes, and seconds.</p> <pre><code>resolve('&lt;timestamp') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>return</em>&gt;</td> <td>string</td> <td>A string of the evaluated TimexProperty or Timex expression.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples show if the given strings refer to valid time:</p> <pre><code>resolve(T14) resolve(2020-12-20) resolve(2020-12-20T14:20) </code></pre> <p>And returns the following results respectively:</p> <ul> <li><strong>14:00:00</strong></li> <li><strong>2020-12-20</strong></li> <li><strong>2020-12-20 14:20:00</strong></li> </ul> <p><a name="reverse"></a></p> <h3 id="reverse">reverse</h3> <p>Reverse the order of the elements in a string or array.</p> <pre><code>reverse(&lt;value&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The string to array to reverse.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>return</em>&gt;</td> <td>string or array</td> <td>The reversed elements of a string or array.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples reverse the elements of a string or array:</p> <pre><code>reverse(hello) reverse(concat(hello,world)) </code></pre> <p>And return the following values respectively:</p> <p>-The string <strong>olleh</strong>. -The string <strong>dlrowolleh</strong>.</p> <p><a name="round"></a></p> <h3 id="round">round</h3> <p>Round a value to the nearest integer or to the specified number of fractional digits.</p> <pre><code>round('&lt;number&gt;', '&lt;precision-digits&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number</em>&gt;</td> <td>Yes</td> <td>number</td> <td>An input number</td> </tr> <tr> <td>&lt;<em>precision-digits</em>&gt;</td> <td>No</td> <td>integer</td> <td>A specified number of fractional digits. The default is 0.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>return-value</em>&gt;</td> <td>number</td> <td>The return value of the input rounded at a specified number of fractional digits</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example rounds the number <strong>10.333</strong>:</p> <pre><code>round(10.333) </code></pre> <p>And returns the number <strong>10</strong>.</p> <p><em>Example 2</em></p> <p>This example rounds the number <strong>10.3313</strong> to <strong>2</strong> fractional digits:</p> <pre><code>round(10.3313, 2) </code></pre> <p>And returns the number <strong>10.33</strong>.</p> <p><a name="select"></a></p> <h3 id="select">select</h3> <p>Operate on each element and return the new collection of transformed elements.</p> <pre><code>select([&lt;collection/instance&gt;], &lt;iteratorName&gt;, &lt;function&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection/instance</em>&gt;</td> <td>Yes</td> <td>array</td> <td>The collection with the items</td> </tr> <tr> <td>&lt;<em>iteratorName</em>&gt;</td> <td>Yes</td> <td>iterator name</td> <td>The key item</td> </tr> <tr> <td>&lt;<em>function</em>&gt;</td> <td>Yes</td> <td>expression</td> <td>Th function that can contains <code>iteratorName</code></td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>new-collection</em>&gt;</td> <td>array</td> <td>The new collection in which each element has been evaluated with the function</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example generates a new collection:</p> <pre><code>select(createArray(0, 1, 2, 3), x, x + 1) </code></pre> <p>And returns the result <strong>[1, 2, 3, 4]</strong>.</p> <p><em>Example 2</em></p> <p>These examples generate a new collection:</p> <pre><code>select(json("{'name': 'jack', 'age': '15'}"), x, concat(x.key, ':', x.value)) select(json("{'name': 'jack', 'age': '15'}"), x=&gt; concat(x.key, ':', x.value)) </code></pre> <p>And return the result <strong>['name:jack', 'age:15']</strong>. Note that the second expression is a <em>lambda expression</em>, which some find more readable.</p> <p><a name="sentenceCase"></a></p> <h3 id="sentencecase">sentenceCase</h3> <p>Capitalize the first letter of the first word in a string in an optional locale format.</p> <pre><code>sentenceCase('&lt;text&gt;', '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The original string</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>result string</td> <td>string</td> <td>Returns the sentence case result</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>These examples capitalize the first letter in a string:</p> <pre><code>sentenceCase('a') sentenceCase('abc def') sentenceCase('aBC dEF') </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>A</strong></li> <li><strong>Abc def</strong></li> <li><strong>Abc def</strong></li> </ul> <p><em>Example 2</em></p> <p>These examples capitalizes the first letter in a string in the specified locale format:</p> <pre><code>sentenceCase('a', 'fr-FR') sentenceCase('abc', 'en-US') sentenceCase('aBC', 'fr-FR') </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>A</strong></li> <li><strong>Abc</strong></li> <li><strong>Abc</strong></li> </ul> <p><a name="setPathToValue"></a></p> <h3 id="setpathtovalue">setPathToValue</h3> <p>Retrieve the value of the specified property from the JSON object.</p> <pre><code>setPathToValue(&lt;path&gt;, &lt;value&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>Path</em>&gt;</td> <td>Yes</td> <td>object</td> <td>The path which you want to set</td> </tr> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>object</td> <td>The value you want to set to the path</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>value</td> <td>object</td> <td>The value be set</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>The example below sets the value <strong>1</strong> to the path:</p> <pre><code>setPathToValue(path.x, 1) </code></pre> <p>And returns the result <strong>1</strong>. <code>path.x</code> is set to <strong>1</strong>.</p> <p><em>Example 2</em></p> <p>This example below sets the value:</p> <pre><code>setPathToValue(path.array[0], 7) + path.array[0] </code></pre> <p>And returns the result <strong>14</strong>.</p> <p><a name="setProperty"></a></p> <h3 id="setproperty">setProperty</h3> <p>Set the value of an object's property and return the updated object. To add a new property, use this function or the <a href="#addProperty" data-linktype="self-bookmark">addProperty()</a> function.</p> <pre><code>setProperty(&lt;object&gt;, '&lt;property&gt;', &lt;value&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>object</em>&gt;</td> <td>Yes</td> <td>object</td> <td>The JSON object in which you want to set a property</td> </tr> <tr> <td>&lt;<em>property</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The name of the property to set</td> </tr> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The value to set for the specified property</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-object</em>&gt;</td> <td>object</td> <td>The updated JSON object whose property you set</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example sets the <code>accountNumber</code> property on a <code>customerProfile</code> object, which is converted to JSON with the <a href="#json" data-linktype="self-bookmark">json()</a> function. The function assigns a value generated by the <a href="#newGuid" data-linktype="self-bookmark">newGuid()</a> function, and returns the updated JSON object:</p> <pre><code>setProperty(json('customerProfile'), 'accountNumber', newGuid()) </code></pre> <p><a name="skip"></a></p> <h3 id="skip">skip</h3> <p>Remove items from the front of a collection, and return all the other items.</p> <pre><code>skip([&lt;collection&gt;], &lt;count&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>array</td> <td>The collection whose items you want to remove</td> </tr> <tr> <td>&lt;<em>count</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>A positive integer for the number of items to remove at the front</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updatedCollection</em>&gt;</td> <td>array</td> <td>The updated collection after removing the specified items</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example removes one item, the number <em>1</em>, from the front of the specified array:</p> <pre><code>skip(createArray(0, 1, 2, 3), 1) </code></pre> <p>And returns an array with the remaining items: <strong>[1,2,3]</strong>.</p> <p><a name="sortBy"></a></p> <h3 id="sortby">sortBy</h3> <p>Sort elements in the collection in ascending order and return the sorted collection.</p> <pre><code>sortBy([&lt;collection&gt;], '&lt;property&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The collection to sort</td> </tr> <tr> <td>&lt;<em>property</em>&gt;</td> <td>No</td> <td>string</td> <td>Sort by this specific property of the object element in the collection if set</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>new-collection</em>&gt;</td> <td>array</td> <td>The new collection whose elements have been sorted</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example generates sorts the following collection:</p> <pre><code>sortBy(createArray(1, 2, 0, 3)) </code></pre> <p>And return the result <strong>[0, 1, 2, 3]</strong>.</p> <p><em>Example 2</em></p> <p>Suppose you have the following collection:</p> <pre><code class="lang-json">{ 'nestedItems': [ {'x': 2}, {'x': 1}, {'x': 3} ] } </code></pre> <p>This example generates a new sorted collection based on the <strong>x</strong> object property</p> <pre><code>sortBy(nestedItems, 'x') </code></pre> <p>And returns the result:</p> <pre><code class="lang-json">{ 'nestedItems': [ {'x': 1}, {'x': 2}, {'x': 3} ] } </code></pre> <p><a name="sortByDescending"></a></p> <h3 id="sortbydescending">sortByDescending</h3> <p>Sort elements in the collection in descending order, and return the sorted collection.</p> <pre><code>sortBy([&lt;collection&gt;], '&lt;property&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The collection to sort</td> </tr> <tr> <td>&lt;<em>property</em>&gt;</td> <td>No</td> <td>string</td> <td>Sort by this specific property of the object element in the collection if set</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>new-collection</em>&gt;</td> <td>array</td> <td>The new collection whose elements have been sorted</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example generates a new sorted collection:</p> <pre><code>sortByDescending(createArray(1, 2, 0, 3)) </code></pre> <p>And returns the result <strong>[3, 2, 1, 0]</strong>.</p> <p><em>Example 2</em></p> <p>Suppose you have the following collection:</p> <pre><code class="lang-json">{ 'nestedItems': [ {'x': 2}, {'x': 1}, {'x': 3} ] } </code></pre> <p>This example generates a new sorted collection based on the <strong>x</strong> object property:</p> <pre><code>sortByDescending(nestedItems, 'x') </code></pre> <p>And returns this result:</p> <pre><code class="lang-json">{ 'nestedItems': [ {'x': 3}, {'x': 2}, {'x': 1} ] } </code></pre> <p><a name="split"></a></p> <h3 id="split">split</h3> <p>Return an array that contains substrings, separated by commas, based on the specified delimiter character in the original string.</p> <pre><code>split('&lt;text&gt;', '&lt;delimiter&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to separate into substrings based on the specified delimiter in the original string. If the text is a null value, it will be taken as an empty string.</td> </tr> <tr> <td>&lt;<em>delimiter</em>&gt;</td> <td>No</td> <td>string</td> <td>The character in the original string to use as the delimiter. If no delimiter provided or the delimiter is a null value, the default value will be an empty string.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>[&lt;<em>substring1</em>&gt;,&lt;<em>substring2</em>&gt;,...]</td> <td>array</td> <td>An array that contains substrings from the original string, separated by commas</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples create an array with substrings from the specified string based on the specified delimiter character:</p> <pre><code>split('a**b**c', '**') split('hello', '') split('', 'e') split('', '') split('hello') </code></pre> <p>And returns the following arrays as the result respectively:</p> <ul> <li><strong>["a", "b", "c"]</strong></li> <li><strong>["h", "e", "l", "l", "o"]</strong></li> <li><strong>[""]</strong>, <strong>[ ]</strong></li> <li><strong>["h", "e", "l", "l", "o"]</strong></li> </ul> <p><a name="sqrt"></a></p> <h3 id="sqrt">sqrt</h3> <p>Return the square root of a specified number.</p> <pre><code>sqrt(&lt;number&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number</em>&gt;</td> <td>Yes</td> <td>number</td> <td>Number to get square root of of</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result</em>&gt;</td> <td>number</td> <td>The result from computing the square root.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples compute the square root of specified numbers:</p> <pre><code>sqrt(9) sqrt(0) </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>3</strong></li> <li><strong>0</strong></li> </ul> <p><a name="startOfDay"></a></p> <h3 id="startofday">startOfDay</h3> <p>Return the start of the day for a timestamp in an optional locale format.</p> <pre><code>startOfDay('&lt;timestamp&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>'&lt;<em>updated-timestamp</em>&gt;'</td> <td>string</td> <td>The specified timestamp starting at the zero-hour mark for the day</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example finds the start of the day:</p> <pre><code>startOfDay('2018-03-15T13:30:30.000Z') </code></pre> <p>And returns the result <strong>2018-03-15T00:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example finds the start of the day with the locale <strong>fr-FR</strong>:</p> <pre><code>startOfDay('2018-03-15T13:30:30.000Z', '', 'fr-FR') </code></pre> <p>And returns the result <strong>15/03/2018 00:00:00</strong>.</p> <p><a name="startOfHour"></a></p> <h3 id="startofhour">startOfHour</h3> <p>Return the start of the hour for a timestamp in an optional locale format.</p> <pre><code>startOfHour('&lt;timestamp&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>'&lt;<em>updated-timestamp</em>&gt;'</td> <td>string</td> <td>The specified timestamp starting at the zero-minute mark for the day</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example finds the start of the hour:</p> <pre><code>startOfHour('2018-03-15T13:30:30.000Z') </code></pre> <p>And returns the result <strong>2018-03-15T13:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example finds the start of the hour with the locale <strong>fr-FR</strong>:</p> <pre><code>startOfHour('2018-03-15T13:30:30.000Z', '', 'fr-FR') </code></pre> <p>And returns the result <strong>15/03/2018 13:00:00</strong>.</p> <p><a name="startOfMonth"></a></p> <h3 id="startofmonth">startOfMonth</h3> <p>Return the start of the month for a timestamp in an optional locale format.</p> <pre><code>startOfMonth('&lt;timestamp&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>'&lt;<em>updated-timestamp</em>&gt;'</td> <td>string</td> <td>The specified timestamp starting on the first day of the month at the zero-hour mark</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example finds the start of the month:</p> <pre><code>startOfMonth('2018-03-15T13:30:30.000Z') </code></pre> <p>And returns the result <strong>2018-03-01T00:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example finds the start of the month with the locale <strong>fr-FR</strong>:</p> <pre><code>startOfMonth('2018-03-15T13:30:30.000Z', '', 'fr-FR') </code></pre> <p>And returns the result <strong>01/03/2018 00:00:00</strong>.</p> <p><a name="startsWith"></a></p> <h3 id="startswith">startsWith</h3> <p>Check whether a string starts with a specific substring. Return <code>true</code> if the substring is found, or return <code>false</code> if not found. This function is case-insensitive.</p> <pre><code>startsWith('&lt;text&gt;', '&lt;searchText&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to check</td> </tr> <tr> <td>&lt;<em>searchText</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The starting substring to find</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>true or false</td> <td>Boolean</td> <td>Return <code>true</code> if the starting substring is found. Return <code>false</code> if not found</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example checks whether the string <strong>hello world</strong> starts with the string <strong>hello</strong>:</p> <pre><code>startsWith('hello world', 'hello') </code></pre> <p>And returns the result <code>true</code>.</p> <p><em>Example 2</em></p> <p>This example checks whether the string <strong>hello world</strong> starts with the string <strong>greeting</strong>:</p> <pre><code>startsWith('hello world', 'greeting') </code></pre> <p>And returns the result <code>false</code>.</p> <p><a name="string"></a></p> <h3 id="string">string</h3> <p>Return the string version of a value in an optional locale format.</p> <pre><code>string(&lt;value&gt;, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The value to convert</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>string-value</em>&gt;</td> <td>string</td> <td>The string version of the specified value</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example creates the string version of the number <strong>10</strong>:</p> <pre><code>string(10) </code></pre> <p>And returns the string result <strong>10</strong>.</p> <p><em>Example 2</em></p> <p>This example creates a string for the specified JSON object and uses the backslash character,<strong>\\</strong>, as an escape character for the double-quotation mark character, <strong>"</strong>.</p> <pre><code>string( { "name": "Sophie Owen" } ) </code></pre> <p>And returns the result <strong>{ "name": "Sophie Owen" }</strong></p> <p><em>Example 3</em></p> <p>These example creates a string version of the number <strong>10</strong> in a specific locale:</p> <pre><code>string(100.1, 'fr-FR') string(100.1, 'en-US') </code></pre> <p>And returns the following strings respectively:</p> <ul> <li><strong>100,1</strong></li> <li><strong>100.1</strong></li> </ul> <p><a name="stringOrValue"></a></p> <h3 id="stringorvalue">stringOrValue</h3> <p>Wrap string interpolation to get the real value. For example, <code>stringOrValue('${1}')</code> returns the number 1, while<code> stringOrValue('${1} item')</code> returns the string "1 item".</p> <pre><code>stringOrValue(&lt;string&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>string</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to get the real value from.</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result</em>&gt;</td> <td>any</td> <td>The result of getting the real value of the specified string.</td> </tr> </tbody> </table> <p><em>Examples</em></p> <p>These examples get the real value from the string:</p> <pre><code>stringOrValue('${one}') stringOrValue('${one} item') </code></pre> <p>And return the following results respectively:</p> <ul> <li>The number <strong>1.0</strong>.</li> <li>The string <strong>1 item</strong>.</li> </ul> <p><a name="sub"></a></p> <h3 id="sub">sub</h3> <p>Return the result from subtracting the second number from the first number.</p> <pre><code>sub(&lt;minuend&gt;, &lt;subtrahend&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>minuend</em>&gt;</td> <td>Yes</td> <td>number</td> <td>The number from which to subtract the <em>subtrahend</em></td> </tr> <tr> <td>&lt;<em>subtrahend</em>&gt;</td> <td>Yes</td> <td>number</td> <td>The number to subtract from the <em>minuend</em></td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result</em>&gt;</td> <td>number</td> <td>The result from subtracting the second number from the first number</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example subtracts the second number from the first number:</p> <pre><code>sub(10.3, .3) </code></pre> <p>And returns the result <strong>10</strong>.</p> <p><a name="subArray"></a></p> <h3 id="subarray">subArray</h3> <p>Returns a subarray from specified start and end positions. Index values start with the number 0.</p> <pre><code>subArray(&lt;Array&gt;, &lt;startIndex&gt;, &lt;endIndex&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>array</em>&gt;</td> <td>Yes</td> <td>array</td> <td>The array to create the subarray from</td> </tr> <tr> <td>&lt;<em>startIndex</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>A positive number equal to or greater than 0 to use as the starting position or index value</td> </tr> <tr> <td>&lt;<em>endIndex</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>A positive number equal to or greater than 0 to use as the ending position or index value</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>subarray-result</em>&gt;</td> <td>array</td> <td>A subarray with the specified number of items, starting at the specified index position in the source string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates a subarray from the specified array:</p> <pre><code>subArray(createArray('H','e','l','l','o'), 2, 5) </code></pre> <p>And returns the result <strong>["l", "l", "o"]</strong>.</p> <p><a name="substring"></a></p> <h3 id="substring">substring</h3> <p>Return characters from a string, starting from the specified position or index. Index values start with the number 0.</p> <pre><code>substring('&lt;text&gt;', &lt;startIndex&gt;, &lt;length&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to create the substring from</td> </tr> <tr> <td>&lt;<em>startIndex</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>A positive number equal to or greater than 0 subarray to use as the starting position or index value</td> </tr> <tr> <td>&lt;<em>length</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>A positive number of characters subarray in the substring</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>substring-result</em>&gt;</td> <td>string</td> <td>A substring with the specified number of characters, starting at the specified index position in the source string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates a five-character substring from the specified string, starting from the index value 6:</p> <pre><code>substring('hello world', 6, 5) </code></pre> <p>And returns the result <strong>world</strong>.</p> <p><a name="subtractFromTime"></a></p> <h3 id="subtractfromtime">subtractFromTime</h3> <p>Subtract a number of time units from a timestamp in an optional locale format. See also <a href="#getPastTime" data-linktype="self-bookmark">getPastTime()</a>.</p> <pre><code>subtractFromTime('&lt;timestamp&gt;', &lt;interval&gt;, '&lt;timeUnit&gt;', '&lt;format&gt;'?, '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> <tr> <td>&lt;<em>interval</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The number of specified time units to subtract</td> </tr> <tr> <td>&lt;<em>timeUnit</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The unit of time to use with <em>interval</em>. Possible units are "Second", "Minute", "Hour", "Day", "Week", "Month", and "Year".</td> </tr> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updated-timestamp</em>&gt;</td> <td>string</td> <td>The timestamp minus the specified number of time units</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example subtracts one day from a following timestamp:</p> <pre><code>subtractFromTime('2018-01-02T00:00.000Z', 1, 'Day') </code></pre> <p>And returns the result <strong>2018-01-01T00:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>This example subtracts one day from a timestamp using the <strong>D</strong> format:</p> <pre><code>subtractFromTime('2018-01-02T00:00.000Z', 1, 'Day', 'D') </code></pre> <p>And returns the result <strong>Monday, January, 1, 2018</strong>.</p> <p><em>Example 3</em></p> <p>This example subtracts <strong>1</strong> hour from a timestamp in the <strong>de-DE</strong> locale:</p> <pre><code>subtractFromTime('2018-03-15T13:00:00.000Z', 1, 'Hour', '', 'de-DE') </code></pre> <p>And returns the result <strong>15.03.18 12:00:00</strong>.</p> <p><a name="sum"></a></p> <h3 id="sum">sum</h3> <p>Return the result from adding numbers in a list.</p> <pre><code>sum([&lt;list of numbers&gt;]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>[&lt;list of numbers&gt;]</td> <td>Yes</td> <td>array of numbers</td> <td>The numbers to add</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>result-sum</em>&gt;</td> <td>number</td> <td>The result from adding the specified numbers</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example adds the specified numbers:</p> <pre><code>sum(createArray(1, 1.5)) </code></pre> <p>And returns the result <strong>2.5</strong>.</p> <p><a name="take"></a></p> <h3 id="take">take</h3> <p>Return items from the front of a collection.</p> <pre><code>take('&lt;collection&gt;', &lt;count&gt;) take([&lt;collection&gt;], &lt;count&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>string or array</td> <td>The collection whose items you want</td> </tr> <tr> <td>&lt;<em>count</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>A positive integer for the number of items you want from the front</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>subset</em>&gt; or [&lt;<em>subset</em>&gt;]</td> <td>String or Array, respectively</td> <td>A string or array that has the specified number of items taken from the front of the original collection</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>These examples get the specified number of items from the front of these collections:</p> <pre><code>take('abcde', 3) take(createArray(0, 1, 2, 3, 4), 3) </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>abc</strong></li> <li><strong>[0, 1, 2]</strong></li> </ul> <p><a name="ticks"></a></p> <h3 id="ticks">ticks</h3> <p>Return the ticks property value of a specified timestamp. A tick is 100-nanosecond interval.</p> <pre><code>ticks('&lt;timestamp&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string for a timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>ticks-number</em>&gt;</td> <td>integer (bigint in JavaScript)</td> <td>The number of ticks since the specified timestamp</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts a timestamp to its ticks property:</p> <pre><code>ticks('2018-01-01T08:00:00.000Z') </code></pre> <p>And returns the result <strong>636503904000000000</strong>.</p> <p><a name="ticksToDays"></a></p> <h3 id="tickstodays">ticksToDays</h3> <p>Convert a ticks property value to the number of days.</p> <pre><code>ticksToDays('ticks') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>ticks</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The ticks property value to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number-of-days</em>&gt;</td> <td>number</td> <td>The number of days converted from the ticks property value</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts a ticks property value to a number of days:</p> <pre><code>ticksToDays(2193385800000000) </code></pre> <p>And returns the number <strong>2538.64097222</strong>.</p> <p><a name="ticksToHours"></a></p> <h3 id="tickstohours">ticksToHours</h3> <p>Convert a ticks property value to the number of hours.</p> <pre><code>ticksToHours('ticks') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>ticks</em>&gt;</td> <td>Yes</td> <td>Integer</td> <td>The ticks property value to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number-of-hours</em>&gt;</td> <td>number</td> <td>The number of hours converted from the ticks property value</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts a ticks property value to a number of hours:</p> <pre><code>ticksToHours(2193385800000000) </code></pre> <p>And returns the number <strong>60927.383333333331</strong>.</p> <p><a name="ticksToMinutes"></a></p> <h3 id="tickstominutes">ticksToMinutes</h3> <p>Convert a ticks property value to the number of minutes.</p> <pre><code>ticksToMinutes('ticks') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>ticks</em>&gt;</td> <td>Yes</td> <td>integer</td> <td>The ticks property value to convert</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>number-of-minutes</em>&gt;</td> <td>number</td> <td>The number of minutes converted from the ticks property value</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example converts a ticks property value to a number of minutes:</p> <pre><code>ticksToMinutes(2193385800000000) </code></pre> <p>And returns the number <strong>3655643.0185</strong>.</p> <p><a name="titleCase"></a></p> <h3 id="titlecase">titleCase</h3> <p>Capitalize the first letter of each word in a string in an optional local format.</p> <pre><code>titleCase('&lt;text&gt;', '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The original string</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>result string</td> <td>string</td> <td>The title case result</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>These examples capitalize the first letter of each word in a string:</p> <pre><code>titleCase('a') titleCase('abc def') titleCase('aBC dEF') </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>A</strong></li> <li><strong>Abc Def</strong></li> <li><strong>Abc Def</strong></li> </ul> <p><em>Example 2</em></p> <p>These examples capitalize the first letter in a string in the <strong>en-US</strong> format:</p> <pre><code>titleCase('a', 'en-US') titleCase('aBC dEF', 'en-US') </code></pre> <p>And return the following results respectively:</p> <ul> <li><strong>A</strong></li> <li><strong>Abc Def</strong></li> </ul> <p><a name="toLower"></a></p> <h3 id="tolower">toLower</h3> <p>Return a string in lowercase in an optional locale format. If a character in the string doesn't have a lowercase version, that character stays unchanged in the returned string.</p> <pre><code>toLower('&lt;text&gt;', '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to return in lowercase format</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>lowercase-text</em>&gt;</td> <td>string</td> <td>The original string in lowercase format</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example converts a string to lowercase:</p> <pre><code>toLower('Hello World') </code></pre> <p>And returns the result <strong>hello world</strong>.</p> <p><em>Example 2</em></p> <p>This example converts a string to lowercase in the <strong>fr-FR</strong> format:</p> <pre><code>toUpper('Hello World', 'fr-FR') </code></pre> <p>And returns the result <strong>hello world</strong>.</p> <p><a name="toUpper"></a></p> <h3 id="toupper">toUpper</h3> <p>Return a string in uppercase in an optional locale format. If a character in the string doesn't have an uppercase version, that character stays unchanged in the returned string.</p> <pre><code>toUpper('&lt;text&gt;', '&lt;locale&gt;'?) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to return in uppercase format</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>uppercase-text</em>&gt;</td> <td>string</td> <td>The original string in uppercase format</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example converts a string to uppercase:</p> <pre><code>toUpper('Hello World') </code></pre> <p>And returns the result <strong>HELLO WORLD</strong>.</p> <p><em>Example 2</em></p> <p>This example converts a string to uppercase in the <strong>fr-FR</strong> format:</p> <pre><code>toUpper('Hello World', 'fr-FR') </code></pre> <p>And returns the result <strong>HELLO WORLD</strong>.</p> <p><a name="trim"></a></p> <h3 id="trim">trim</h3> <p>Remove leading and trailing whitespace from a string, and return the updated string.</p> <pre><code>trim('&lt;text&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>text</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that has the leading and trailing whitespace to remove</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updatedText</em>&gt;</td> <td>string</td> <td>An updated version for the original string without leading or trailing whitespace</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example removes the leading and trailing whitespace from the string <strong>" Hello World "</strong>:</p> <pre><code>trim(' Hello World ') </code></pre> <p>And returns the trimmed result <strong>Hello World</strong>.</p> <p><a name="union"></a></p> <h3 id="union">union</h3> <p>Return a collection that has all the items from the specified collections. To appear in the result, an item can appear in any collection passed to this function. If one or more items have the same name, the last item with that name appears in the result.</p> <pre><code>union('&lt;collection1&gt;', '&lt;collection2&gt;', ...) union([&lt;collection1&gt;], [&lt;collection2&gt;], ...) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection1</em>&gt;, &lt;<em>collection2</em>&gt;, ...</td> <td>Yes</td> <td>array or object, but not both</td> <td>The collections from where you want all the items</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>updatedCollection</em>&gt;</td> <td>array or object, respectively</td> <td>A collection with all the items from the specified collections. No duplicates added.</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example gets all the items from the following collections:</p> <pre><code>union(createArray(1, 2, 3), createArray(1, 2, 10, 101)) </code></pre> <p>And returns the result <strong>[1, 2, 3, 10, 101]</strong>.</p> <a name="unique"> <h3 id="unique">unique</h3> <p>Remove all duplicates from an array.</p> <pre><code>unique([&lt;collection&gt;]) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection</em>&gt;</td> <td>Yes</td> <td>array</td> <td>The collection to modify</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>new-collection</em>&gt;</td> <td>array</td> <td>New collection with duplicate elements removed</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example removes duplicate elements from the following array:</p> <pre><code>unique(createArray(1, 2, 1)) </code></pre> <p>And returns the result <strong>[1, 2]</strong>.</p> </a><p><a name="unique"></a><a name="uriComponent"></a></p> <h3 id="uricomponent">uriComponent</h3> <p>Return the binary version of a uniform resource identifier (URI) component.</p> <pre><code>uriComponent('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string to convert to URI-encoded format</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>encoded-uri</em>&gt;</td> <td>string</td> <td>The URI-encoded string with escape characters</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates a URI-encoded version of a string:</p> <pre><code>uriComponent('https://contoso.com') </code></pre> <p>And returns the result <strong>http%3A%2F%2Fcontoso.com</strong>.</p> <p><a name="uriComponentToString"></a></p> <h3 id="uricomponenttostring">uriComponentToString</h3> <p>Return the string version of a uniform resource identifier (URI) encoded string, effectively decoding the URI-encoded string.</p> <pre><code>uriComponentToString('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The URI-encoded string to decode</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>binary-for-encoded-uri</em>&gt;</td> <td>string</td> <td>The decoded version for the URI-encoded string</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example creates the decoded string version of a URI-encoded string:</p> <pre><code>uriComponentToString('http%3A%2F%2Fcontoso.com') </code></pre> <p>And returns the result <code>https://contoso.com</code>.</p> <p><a name="uriHost"></a></p> <h3 id="urihost">uriHost</h3> <p>Return the host value of a unified resource identifier (URI).</p> <pre><code>uriHost('&lt;uri&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>uri</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The URI whose host value you want</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>host-value</em>&gt;</td> <td>string</td> <td>The host value of the specified URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the host value of the following URI:</p> <pre><code>uriHost('https://www.localhost.com:8080') </code></pre> <p>And returns the result <code>www.localhost.com</code>.</p> <p><a name="uriPath"></a></p> <h3 id="uripath">uriPath</h3> <p>Return the path value of a unified resource identifier (URI).</p> <pre><code>uriPath('&lt;uri&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>uri</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The URI whose path value you want</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>path-value</em>&gt;</td> <td>string</td> <td>The path value of the specified URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the path value of the following URI:</p> <pre><code>uriPath('http://www.contoso.com/catalog/shownew.htm?date=today') </code></pre> <p>And returns the result <strong>/catalog/shownew.htm</strong>.</p> <p><a name="uriPathAndQuery"></a></p> <h3 id="uripathandquery">uriPathAndQuery</h3> <p>Return the path and query value of a unified resource identifier (URI).</p> <pre><code>uriPathAndQuery('&lt;uri&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>uri</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The URI whose path and query value you want</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>path-query-value</em>&gt;</td> <td>string</td> <td>The path and query value of the specified URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the path and query value of the following URI:</p> <pre><code>uriPathAndQuery('http://www.contoso.com/catalog/shownew.htm?date=today') </code></pre> <p>And returns the result <strong>/catalog/shownew.htm?date=today</strong>.</p> <p><a name="uriPort"></a></p> <h3 id="uriport">uriPort</h3> <p>Return the port value of a unified resource identifier (URI).</p> <pre><code>uriPort('&lt;uri&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>uri</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The URI whose path value you want</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>port-value</em>&gt;</td> <td>string</td> <td>The port value of the specified URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the port value of the following URI:</p> <pre><code>uriPort('http://www.localhost:8080') </code></pre> <p>And returns the result <strong>8080</strong>.</p> <p><a name="uriQuery"></a></p> <h3 id="uriquery">uriQuery</h3> <p>Return the query value of a unified resource identifier (URI).</p> <pre><code>uriQuery('&lt;uri&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>uri</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The URI whose query value you want</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>query-value</em>&gt;</td> <td>string</td> <td>The query value of the specified URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the query value of the following URI:</p> <pre><code>uriQuery('http://www.contoso.com/catalog/shownew.htm?date=today') </code></pre> <p>And returns the result <strong>?date=today</strong>.</p> <p><a name="uriScheme"></a></p> <h3 id="urischeme">uriScheme</h3> <p>Return the scheme value of a unified resource identifier (URI).</p> <pre><code>uriScheme('&lt;uri&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>uri</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The URI whose query value you want</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>scheme-value</em>&gt;</td> <td>string</td> <td>The scheme value of the specified URI</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example finds the scheme value of the following URI:</p> <pre><code>uriQuery('http://www.contoso.com/catalog/shownew.htm?date=today') </code></pre> <p>And returns the result <strong>http</strong>.</p> <p><a name="utcNow"></a></p> <h3 id="utcnow">utcNow</h3> <p>Return the current timestamp in an optional locale format as a string.</p> <pre><code>utcNow('&lt;format&gt;', '&lt;locale&gt;'?) </code></pre> <p>Optionally, you can specify a different format with the &lt;<em>format</em>&gt; parameter.</p> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>format</em>&gt;</td> <td>No</td> <td>string</td> <td>A <a href="/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" data-linktype="absolute-path">custom format pattern</a>. The default format for the timestamp is UTC ISO format, YYYY-MM-DDTHH:mm:ss.fffZ, which complies with <a href="https://www.w3.org/QA/Tips/iso-date" data-linktype="external">ISO 8601</a>.</td> </tr> <tr> <td>&lt;<em>locale</em>&gt;</td> <td>No</td> <td>string</td> <td>An optional locale of culture information</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>current-timestamp</em>&gt;</td> <td>string</td> <td>The current date and time</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>Suppose the date is <strong>April 15, 2018</strong> at <strong>1:00:00 PM</strong>. This example gets the timestamp:</p> <pre><code>utcNow() </code></pre> <p>And returns the result <strong>2018-04-15T13:00:00.000Z</strong>.</p> <p><em>Example 2</em></p> <p>Suppose the date is <strong>April 15, 2018</strong> at <strong>1:00:00 PM</strong>. This example gets the current timestamp using the optional <strong>D</strong> format:</p> <pre><code>utcNow('D') </code></pre> <p>And returns the result <strong>Sunday, April 15, 2018</strong>.</p> <p><em>Example 3</em></p> <p>Suppose the date is <strong>April 15, 2018</strong> at <strong>1:00:00 PM</strong>. This example gets the current timestamp using the <strong>de-DE</strong> locale:</p> <pre><code>utcNow('', 'de-DE') </code></pre> <p>And returns the result <strong>15.04.18 13:00:00</strong>.</p> <p><a name="where"></a></p> <h3 id="where">where</h3> <p>Filter on each element and return the new collection of filtered elements which match a specific condition.</p> <pre><code>where([&lt;collection/instance&gt;], &lt;iteratorName&gt;, &lt;function&gt;) </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>collection/instance</em>&gt;</td> <td>Yes</td> <td>array</td> <td>The collection with the items</td> </tr> <tr> <td>&lt;<em>iteratorName</em>&gt;</td> <td>Yes</td> <td>iterator name</td> <td>The key item</td> </tr> <tr> <td>&lt;<em>function</em>&gt;</td> <td>Yes</td> <td>expression</td> <td>Condition function used to filter items</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>new-collection/new-object</em>&gt;</td> <td>array/object</td> <td>The new collection which each element has been filtered with the function</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example generates a new collection:</p> <pre><code>where(createArray(0, 1, 2, 3), x, x &gt; 1) </code></pre> <p>And returns the result <strong>[2, 3]</strong>.</p> <p><em>Example 2</em></p> <p>These examples generate a new collection:</p> <pre><code>where(json("{'name': 'jack', 'age': '15'}"), x, x.value == 'jack') where(json("{'name': 'jack', 'age': '15'}"), x=&gt; x.value == 'jack') </code></pre> <p>And return the result <strong>['name:jack', 'age:15']</strong>. Note that the second expression is a <em>lambda expression</em>, which some find more readable.</p> <p><a name="xml"></a></p> <h3 id="xml">xml</h3> <p>Return the XML version of a string that contains a JSON object.</p> <pre><code>xml('&lt;value&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>value</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string with the JSON object to convert. The JSON object must have only one root property, which can't be an array. Use <strong>\</strong> as an escape character for the double quotation mark (").</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>xml-version</em>&gt;</td> <td>object</td> <td>The encoded XML for the specified string or JSON object</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example creates the XML version for a string, which contains a JSON object:</p> <p><code>xml(json('{ \"name\": \"Sophia Owen\" }'))</code></p> <p>And returns the result XML:</p> <pre><code class="lang-xml">&lt;name&gt;Sophia Owen&lt;/name&gt; </code></pre> <p><em>Example 2</em></p> <p>Suppose you have a <code>person</code> JSON object, seen below:</p> <pre><code class="lang-json">{ "person": { "name": "Sophia Owen", "city": "Seattle" } } </code></pre> <p>This example creates XML of a string that contains this JSON object:</p> <p><code>xml(json('{\"person\": {\"name\": \"Sophia Owen\", \"city\": \"Seattle\"}}'))</code></p> <p>And returns the result XML:</p> <pre><code class="lang-xml">&lt;person&gt; &lt;name&gt;Sophia Owen&lt;/name&gt; &lt;city&gt;Seattle&lt;/city&gt; &lt;person </code></pre> <p><a name="xPath"></a></p> <h3 id="xpath">xPath</h3> <p>Check XML for nodes or values that match an XPath (XML Path Language) expression, and return the matching nodes or values. An XPath expression (referred to as XPath) helps you navigate an XML document structure so that you can select nodes or compute values in the XML content.</p> <pre><code>xPath('&lt;xml&gt;', '&lt;xpath&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>xml</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The XML string to search for nodes or values that match an XPath expression value</td> </tr> <tr> <td>&lt;<em>xPath</em>&gt;</td> <td>Yes</td> <td>any</td> <td>The XPath expression used to find matching XML nodes or values</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>xml-node</em>&gt;</td> <td>XML</td> <td>An XML node when only a single node matches the specified XPath expression</td> </tr> <tr> <td>&lt;<em>value</em>&gt;</td> <td>any</td> <td>The value from an XML node when only a single value matches the specified XPath expression</td> </tr> <tr> <td>&lt;<em>[&lt;xml-node1&gt;, &lt;xml-node2&gt;, ...] -or- [&lt;value1&gt;, &lt;value2&gt;, ...]</em>&gt;</td> <td>array</td> <td>An array with XML nodes or values that match the specified XPath expression</td> </tr> </tbody> </table> <p><em>Example 1</em></p> <p>This example finds nodes that match the <code>&lt;name&gt;&lt;/name&gt;</code> node in the specified arguments, and returns an array with those node values:</p> <pre><code>xPath(items, '/produce/item/name') </code></pre> <p>The arguments include the <strong>items</strong> string, which contains this XML:</p> <pre><code class="lang-xml">"&lt;?xml version="1.0"?&gt; &lt;produce&gt; &lt;item&gt; &lt;name&gt;Gala&lt;/name&gt; &lt;type&gt;apple&lt;/type&gt; &lt;count&gt;20&lt;/count&gt; &lt;/item&gt; &lt;item&gt; &lt;name&gt;Honeycrisp&lt;/name&gt; &lt;type&gt;apple&lt;/type&gt; &lt;count&gt;10&lt;/count&gt; &lt;/item&gt; &lt;/produce&gt;" </code></pre> <p>Here's the resulting array with the nodes that match <code>&lt;name&gt;&lt;/name&gt;</code>:</p> <pre><code class="lang-json">[ &lt;name&gt;Gala&lt;/name&gt;, &lt;name&gt;Honeycrisp&lt;/name&gt; ] </code></pre> <p><em>Example 2</em></p> <p>Following example 1, this example finds nodes that match the <code>&lt;count&gt;&lt;/count&gt;</code> node and adds those node values with the <a href="#sum" data-linktype="self-bookmark">sum()</a> function:</p> <pre><code>xPath(xml(parameters('items')), 'sum(/produce/item/count)') </code></pre> <p>And returns the result <strong>30</strong>.</p> <p><a name="year"></a></p> <h3 id="year">year</h3> <p>Return the year of the specified timestamp.</p> <pre><code>year('&lt;timestamp&gt;') </code></pre> <table> <thead> <tr> <th>Parameter</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>timestamp</em>&gt;</td> <td>Yes</td> <td>string</td> <td>The string that contains the timestamp</td> </tr> </tbody> </table> <table> <thead> <tr> <th>Return value</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;<em>year</em>&gt;</td> <td>integer</td> <td>The year in the specified timestamp</td> </tr> </tbody> </table> <p><em>Example</em></p> <p>This example evaluates the timestamp for the year:</p> <pre><code>year('2018-03-15T00:00:00.000Z') </code></pre> <p>And it returns the result <strong>2018</strong>.</p> </div><div id="ms--inline-notifications" class="margin-block-xs" data-bi-name="inline-notification"></div><div id="assertive-live-region" role="alert" aria-live="assertive" class="visually-hidden" aria-relevant="additions" aria-atomic="true"></div> <div id="polite-live-region" role="status" aria-live="polite" class="visually-hidden" aria-relevant="additions" aria-atomic="true"></div> <!-- </content> --> </main><!-- recommendations section --><!-- end recommendations section --> <!-- feedback section --><!-- end feedback section --> <!-- feedback report section --><!-- end feedback report section --><aside id="ms--additional-resources-mobile" aria-label="Additional resources" class="display-none-desktop display-none-print" > <hr class="hr" hidden /> <h2 id="ms--additional-resources-mobile-heading" class="title is-3" hidden>Additional resources</h2> <section id="right-rail-recommendations-mobile" data-bi-name="recommendations" hidden></section> <section id="right-rail-training-mobile" data-bi-name="learning-resources-card" hidden></section> <section id="right-rail-events-mobile" data-bi-name="events-card" hidden></section> <section id="right-rail-qna-mobile" data-bi-name="qna-link-card" hidden></section> </aside><div class="border-top is-visible-interactive has-default-focus margin-top-sm "><footer id="footer-interactive" data-bi-name="footer" class="footer-layout"><div class="display-flex gap-xs flex-wrap-wrap is-full-height padding-right-lg-desktop"><a data-mscc-ic="false" class="locale-selector-link button button-sm button-clear flex-shrink-0" href="#" data-bi-name="select-locale"> <span class="icon" aria-hidden="true"> <span class="docon docon-world"></span> </span> <span class="local-selector-link-text"></span></a><div class="ccpa-privacy-link" data-ccpa-privacy-link hidden> <a href="https://aka.ms/yourcaliforniaprivacychoices" class="button button-sm button-clear flex-shrink-0" data-mscc-ic="false" data-bi-name="your-privacy-choices" > <svg role="img" aria-label="California Consumer Privacy Act (CCPA) Opt-Out Icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" xml:space="preserve" height="16" width="43" focusable="false" > <title>California Consumer Privacy Act (CCPA) Opt-Out Icon</title> <path d="M7.4 12.8h6.8l3.1-11.6H7.4C4.2 1.2 1.6 3.8 1.6 7s2.6 5.8 5.8 5.8z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#fff"></path> <path d="M22.6 0H7.4c-3.9 0-7 3.1-7 7s3.1 7 7 7h15.2c3.9 0 7-3.1 7-7s-3.2-7-7-7zm-21 7c0-3.2 2.6-5.8 5.8-5.8h9.9l-3.1 11.6H7.4c-3.2 0-5.8-2.6-5.8-5.8z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#06f"></path> <path d="M24.6 4c.2.2.2.6 0 .8L22.5 7l2.2 2.2c.2.2.2.6 0 .8-.2.2-.6.2-.8 0l-2.2-2.2-2.2 2.2c-.2.2-.6.2-.8 0-.2-.2-.2-.6 0-.8L20.8 7l-2.2-2.2c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0l2.2 2.2L23.8 4c.2-.2.6-.2.8 0z" style="fill:#fff"></path> <path d="M12.7 4.1c.2.2.3.6.1.8L8.6 9.8c-.1.1-.2.2-.3.2-.2.1-.5.1-.7-.1L5.4 7.7c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0L8 8.6l3.8-4.5c.2-.2.6-.2.9 0z" style="fill:#06f"></path> </svg> <span>Your Privacy Choices</span> </a> </div> <div class="flex-shrink-0"> <div class="dropdown has-caret-up"> <button class="dropdown-trigger button button-clear button-sm has-inner-focus theme-dropdown-trigger" aria-controls="theme-menu-interactive" aria-expanded="false" title="Theme" data-bi-name="theme"> <span class="icon"> <span class="docon docon-sun" aria-hidden="true"></span> </span> <span>Theme</span> <span class="icon expanded-indicator" aria-hidden="true"> <span class="docon docon-chevron-down-light"></span> </span> </button> <div class="dropdown-menu" id="theme-menu-interactive" role="menu"> <ul class="theme-selector padding-xxs" role="none"> <li class="theme display-block" role="menuitem"> <button class="button button-clear button-sm theme-control button-block justify-content-flex-start" data-theme-to="light"> <span class="theme-light margin-right-xxs"> <span class="theme-selector-icon border display-inline-block has-body-background" aria-hidden="true"> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 14"> <rect width="22" height="14" class="has-fill-body-background" /> <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" /> <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" /> <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" /> <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" /> <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" /> </svg> </span> </span> <span>Light</span> </button> </li> <li class="theme display-block" role="menuitem"> <button class="button button-clear button-sm theme-control button-block justify-content-flex-start" data-theme-to="dark"> <span class="theme-dark margin-right-xxs"> <span class="border theme-selector-icon display-inline-block has-body-background" aria-hidden="true"> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 14"> <rect width="22" height="14" class="has-fill-body-background" /> <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" /> <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" /> <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" /> <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" /> <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" /> </svg> </span> </span> <span>Dark</span> </button> </li> <li class="theme display-block" role="menuitem"> <button class="button button-clear button-sm theme-control button-block justify-content-flex-start" data-theme-to="high-contrast"> <span class="theme-high-contrast margin-right-xxs"> <span class="border theme-selector-icon display-inline-block has-body-background" aria-hidden="true"> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 14"> <rect width="22" height="14" class="has-fill-body-background" /> <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" /> <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" /> <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" /> <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" /> <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" /> </svg> </span> </span> <span>High contrast</span> </button> </li> </ul> </div> </div> </div> </div> <ul class="links" data-bi-name="footerlinks"> <li class="manage-cookies-holder" hidden></li><li><a class="external-link-indicator" data-mscc-ic="false" href="/en-us/previous-versions/" data-bi-name="archivelink">Previous Versions</a></li> <li><a class="external-link-indicator" data-mscc-ic="false" href="https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog" data-bi-name="bloglink">Blog</a></li> <li><a class="external-link-indicator" data-mscc-ic="false" href="/en-us/contribute/" data-bi-name="contributorGuide">Contribute</a></li><li><a class="external-link-indicator" data-mscc-ic="false" href="https://go.microsoft.com/fwlink/?LinkId=521839" data-bi-name="privacy">Privacy</a></li><li><a class="external-link-indicator" data-mscc-ic="false" href="/en-us/legal/termsofuse" data-bi-name="termsofuse">Terms of Use</a></li><li><a class="external-link-indicator" data-mscc-ic="false" href="https://www.microsoft.com/legal/intellectualproperty/Trademarks/" data-bi-name="trademarks">Trademarks</a></li><li>&copy; Microsoft 2024</li> </ul> </footer></div></div><div id="ms--additional-resources" class="right-container column is-4-desktop display-none display-block-desktop" data-bi-name="pageactions" role="complementary" aria-label="Additional resources" > <div id="affixed-right-container" class="margin-top-sm-tablet" data-bi-name="right-column"> <h2 id="ms--additional-resources-heading" class="title is-6 margin-top-md" hidden>Additional resources</h2> <section id="right-rail-events" data-bi-name="events-card" hidden></section> <section id="right-rail-training" data-bi-name="learning-resources-card" hidden></section> <section id="right-rail-recommendations" data-bi-name="recommendations" hidden></section> <nav id="side-doc-outline" class="doc-outline" data-bi-name="intopic toc" aria-label="In this article"> <h3>In this article</h3> </nav> <section id="right-rail-qna" class="margin-top-xxs" data-bi-name="qna-link-card" hidden></section> </div> </div></div> <!--end of div.columns --> </section> <!--end of .primary-holder --> <!-- interactive container --> <aside id="interactive-container" class="interactive-container is-visible-interactive column has-body-background-dark "> </aside> <!-- end of interactive container --> </div> </div> <!--end of .mainContainer --> <section class="border-top has-default-focus is-hidden-interactive margin-top-sm "><footer id="footer" data-bi-name="footer" class="footer-layout uhf-container has-padding" role="contentinfo"><div class="display-flex gap-xs flex-wrap-wrap is-full-height padding-right-lg-desktop"><a data-mscc-ic="false" class="locale-selector-link button button-sm button-clear flex-shrink-0" href="#" data-bi-name="select-locale"> <span class="icon" aria-hidden="true"> <span class="docon docon-world"></span> </span> <span class="local-selector-link-text"></span></a><div class="ccpa-privacy-link" data-ccpa-privacy-link hidden> <a href="https://aka.ms/yourcaliforniaprivacychoices" class="button button-sm button-clear flex-shrink-0" data-mscc-ic="false" data-bi-name="your-privacy-choices" > <svg role="img" aria-label="California Consumer Privacy Act (CCPA) Opt-Out Icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" xml:space="preserve" height="16" width="43" focusable="false" > <title>California Consumer Privacy Act (CCPA) Opt-Out Icon</title> <path d="M7.4 12.8h6.8l3.1-11.6H7.4C4.2 1.2 1.6 3.8 1.6 7s2.6 5.8 5.8 5.8z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#fff"></path> <path d="M22.6 0H7.4c-3.9 0-7 3.1-7 7s3.1 7 7 7h15.2c3.9 0 7-3.1 7-7s-3.2-7-7-7zm-21 7c0-3.2 2.6-5.8 5.8-5.8h9.9l-3.1 11.6H7.4c-3.2 0-5.8-2.6-5.8-5.8z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#06f"></path> <path d="M24.6 4c.2.2.2.6 0 .8L22.5 7l2.2 2.2c.2.2.2.6 0 .8-.2.2-.6.2-.8 0l-2.2-2.2-2.2 2.2c-.2.2-.6.2-.8 0-.2-.2-.2-.6 0-.8L20.8 7l-2.2-2.2c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0l2.2 2.2L23.8 4c.2-.2.6-.2.8 0z" style="fill:#fff"></path> <path d="M12.7 4.1c.2.2.3.6.1.8L8.6 9.8c-.1.1-.2.2-.3.2-.2.1-.5.1-.7-.1L5.4 7.7c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0L8 8.6l3.8-4.5c.2-.2.6-.2.9 0z" style="fill:#06f"></path> </svg> <span>Your Privacy Choices</span> </a> </div> <div class="flex-shrink-0"> <div class="dropdown has-caret-up"> <button class="dropdown-trigger button button-clear button-sm has-inner-focus theme-dropdown-trigger" aria-controls="theme-menu" aria-expanded="false" title="Theme" data-bi-name="theme"> <span class="icon"> <span class="docon docon-sun" aria-hidden="true"></span> </span> <span>Theme</span> <span class="icon expanded-indicator" aria-hidden="true"> <span class="docon docon-chevron-down-light"></span> </span> </button> <div class="dropdown-menu" id="theme-menu" role="menu"> <ul class="theme-selector padding-xxs" role="none"> <li class="theme display-block" role="menuitem"> <button class="button button-clear button-sm theme-control button-block justify-content-flex-start" data-theme-to="light"> <span class="theme-light margin-right-xxs"> <span class="theme-selector-icon border display-inline-block has-body-background" aria-hidden="true"> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 14"> <rect width="22" height="14" class="has-fill-body-background" /> <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" /> <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" /> <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" /> <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" /> <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" /> </svg> </span> </span> <span>Light</span> </button> </li> <li class="theme display-block" role="menuitem"> <button class="button button-clear button-sm theme-control button-block justify-content-flex-start" data-theme-to="dark"> <span class="theme-dark margin-right-xxs"> <span class="border theme-selector-icon display-inline-block has-body-background" aria-hidden="true"> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 14"> <rect width="22" height="14" class="has-fill-body-background" /> <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" /> <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" /> <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" /> <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" /> <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" /> </svg> </span> </span> <span>Dark</span> </button> </li> <li class="theme display-block" role="menuitem"> <button class="button button-clear button-sm theme-control button-block justify-content-flex-start" data-theme-to="high-contrast"> <span class="theme-high-contrast margin-right-xxs"> <span class="border theme-selector-icon display-inline-block has-body-background" aria-hidden="true"> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 14"> <rect width="22" height="14" class="has-fill-body-background" /> <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" /> <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" /> <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" /> <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" /> <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" /> <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" /> </svg> </span> </span> <span>High contrast</span> </button> </li> </ul> </div> </div> </div> </div> <ul class="links" data-bi-name="footerlinks"> <li class="manage-cookies-holder" hidden></li><li><a class="external-link-indicator" data-mscc-ic="false" href="/en-us/previous-versions/" data-bi-name="archivelink">Previous Versions</a></li> <li><a class="external-link-indicator" data-mscc-ic="false" href="https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog" data-bi-name="bloglink">Blog</a></li> <li><a class="external-link-indicator" data-mscc-ic="false" href="/en-us/contribute/" data-bi-name="contributorGuide">Contribute</a></li><li><a class="external-link-indicator" data-mscc-ic="false" href="https://go.microsoft.com/fwlink/?LinkId=521839" data-bi-name="privacy">Privacy</a></li><li><a class="external-link-indicator" data-mscc-ic="false" href="/en-us/legal/termsofuse" data-bi-name="termsofuse">Terms of Use</a></li><li><a class="external-link-indicator" data-mscc-ic="false" href="https://www.microsoft.com/legal/intellectualproperty/Trademarks/" data-bi-name="trademarks">Trademarks</a></li><li>&copy; Microsoft 2024</li> </ul> </footer> </section> <div id="action-panel" role="region" aria-label="Action Panel" class="action-panel has-default-focus" tabindex="-1"></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10