--- title: "Typecasting Expressions" slug: "typecasting-expressions" updated: 2023-10-31T15:25:00Z published: 2023-10-31T15:25:00Z canonical: "support.tulip.co/typecasting-expressions" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # タイプキャスティング表現 *エクスプレッション・エディターを使ってデータ型を変更する方法について説明します。* 型キャストとは、異なるメソッドやコンテキストでデータを使用するために、データ型を別のデータ型に変換する方法です。Tulipでは、TriggerのExpression Editorを使用してデータをタイプキャストできます。 --- ## テキストの変換 **texttoboolean()**テキストをブール値にパースします。"y"、"yes"、"t"、"true"、"on"(および大文字の変化形)はtrueとして認識され、"n"、"no"、"f"、"false"、"off "はfalseとして認識されます。 ![texttoboolean expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttoboolean%20expression.png) 以下の例では、左側の各テキスト変数が右側のブール値に変換されます。 ![texttoboolean expression in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttoboolean%20expression%20in%20app.png) **texttodatetime(**) 指定された text データ型を Datetime データ型に変更する。 注意: この式では、式にタイムゾーンを含める必要があります。サポートされるタイムゾーンの一覧については、[この Web サイトを](https://www.php.net/manual/en/timezones.php)参照してください。 ![texttodatetime expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttodatetime%20expression%20ex.png) ![texttodatetime expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttodatetime%20expression%20ex%20in%20app.png) **texttofile(**) テキストをファイルに変換します。 ![texttofile expressions ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttofile%20expressions%20ex.png) **texttoimageurl(**) テキストを画像 URL に変換します。 ![texttoimageurl expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttoimageurl%20expression%20ex.png) ![texttofile and imageurl expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttofile%20and%20imageurl%20expression%20ex%20in%20app.gif) **texttointeger(**) テキストを整数にパースします。 ![texttointeger expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttointeger%20expression%20ex.png) **texttonumber(**) テキストあるいはタイムスタンプを数値にパースする ![texttonumber expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/texttonumber%20expression%20ex.png) ## テキストへの変換 **datetimetotext(**) 指定した datetime データ型を text データ型に変更します。 ![datetimetotext expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/datetimetotext%20expression%20ex.png) ![datetimetotext expressions ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/datetimetotext%20expressions%20ex%20in%20app.png) **filetotext**() ファイルをテキストに変換する ![filetotext expressions ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/filetotext%20expressions%20ex.png) ![filetotext expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/filetotext%20expression%20ex%20in%20app.png) **totext(**) 何でもテキストにパースする ## その他の型キャスト式 **badge_idto_user(**) バッジ ID を User オブジェクトに変換します。 ![badge_id_to_user expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/badge_id_to_user%20expression%20ex.png) ![badge_id_to_user expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/badge_id_to_user%20expression%20ex%20in%20app.png) **int_to_hex(**) 指定した数値の 16 進数表現を返します。 ![int_to_hex expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex.png) ![int_to_hex expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex%20in%20app.png) **hex_to_int(**) 指定した 16 進文字列の数値表現を返します。 ![hex_to_int expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/hex_to_int%20expression%20ex.png) ![hex_to_int expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/hex_to_int%20expression%20ex%20in%20app.png) **interval_to_seconds**() 間隔の長さを秒で返す ![int_to_hex expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex.png) ![int_to_hex expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/int_to_hex%20expression%20ex%20in%20app.png) **interval_to_seconds**() 区間の長さを秒で返す ![seconds_to_interval expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/seconds_to_interval%20expression%20ex.png) **seconds_to_interval()**秒をインターバルに変換する ![interval_to_seconds expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/interval_to_seconds%20expression%20ex.png) ![intervals and seconds expressions ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/intervals%20and%20seconds%20expressions%20ex%20in%20app.gif) **user_id_to_user**() ユーザ ID をユーザ・オブジェクトに変換する ![user_id_to_user expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/user_id_to_user%20expression%20ex.png) ![user_id_to_user expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/user_id_to_user%20expression%20ex%20in%20app.png) --- お探しのものは見つかりましたか? [community.tulip.coに](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all)質問を投稿したり、他の人が同じような質問に直面していないか確認することもできます!