MENU
    タイプキャスティング表現
    • 31 Oct 2023
    • 1 読む分
    • 寄稿者

    タイプキャスティング表現


    記事の要約

    エクスプレッション・エディターを使ってデータ型を変更する方法について説明します。

    型キャストとは、異なるメソッドやコンテキストでデータを使用するために、データ型を別のデータ型に変換する方法です。Tulipでは、TriggerのExpression Editorを使用してデータをタイプキャストできます。


    テキストの変換

    **texttoboolean()**テキストをブール値にパースします。"y"、"yes"、"t"、"true"、"on"(および大文字の変化形)はtrueとして認識され、"n"、"no"、"f"、"false"、"off "はfalseとして認識されます。

    texttoboolean expression

    以下の例では、左側の各テキスト変数が右側のブール値に変換されます。

    texttoboolean expression in app

    texttodatetime() 指定された text データ型を Datetime データ型に変更する。

    注意: この式では、式にタイムゾーンを含める必要があります。サポートされるタイムゾーンの一覧については、この Web サイトを参照してください。

    texttodatetime expression ex

    texttodatetime expression ex in app

    texttofile() テキストをファイルに変換します。

    texttofile expressions ex

    texttoimageurl() テキストを画像 URL に変換します。

    texttoimageurl expression ex

    texttofile and imageurl expression ex in app

    texttointeger() テキストを整数にパースします。

    texttointeger expression ex

    texttonumber() テキストあるいはタイムスタンプを数値にパースする

    texttonumber expression ex

    テキストへの変換

    datetimetotext() 指定した datetime データ型を text データ型に変更します。

    datetimetotext expression ex

    datetimetotext expressions ex in app

    filetotext() ファイルをテキストに変換する

    filetotext expressions ex

    filetotext expression ex in app

    totext() 何でもテキストにパースする

    その他の型キャスト式

    badge_idto_user() バッジ ID を User オブジェクトに変換します。

    badge_id_to_user expression ex

    badge_id_to_user expression ex in app

    int_to_hex() 指定した数値の 16 進数表現を返します。

    int_to_hex expression ex

    int_to_hex expression ex in app

    hex_to_int() 指定した 16 進文字列の数値表現を返します。

    hex_to_int expression ex

    hex_to_int expression ex in app

    interval_to_seconds() 間隔の長さを秒で返す

    int_to_hex expression ex

    int_to_hex expression ex in app

    interval_to_seconds() 区間の長さを秒で返す

    seconds_to_interval expression ex

    **seconds_to_interval()**秒をインターバルに変換する

    interval_to_seconds expression ex

    intervals and seconds expressions ex in app

    user_id_to_user() ユーザ ID をユーザ・オブジェクトに変換する

    user_id_to_user expression ex

    user_id_to_user expression ex in app


    お探しのものは見つかりましたか?

    community.tulip.coに質問を投稿したり、他の人が同じような質問に直面していないか確認することもできます!


    この記事は役に立ちましたか?