I want to process text type date data stored in a record type as date type data.(レコードタイプに格納されたテキスト型の日付データを、日付型データとして処理したい)

Hello, thank you for everything.
There is something I would like to discuss with you today.

Within the interface's expression mode, I am attempting to retrieve data from a record type, aggregate that data, and display it in a graph.
The aggregation process is done in units of month and year, such as the total amount for each month in 2024.
I prepared a temporary record type for practice. If all the target data contained in the record type is of date type, the implementation was successful.

However, among the designed record types, there are fields that are text type and have date data. This is text type data such as "2024/11/04".
I would like to convert the value of this item to date type data between acquisition and aggregation processing. If it is a text type, conversion can be achieved using todatetime().

However, this function does not work well for data obtained from record types. The error is that it is a record type type or a record field type, and that these types cannot be converted to a date type.

Is it not possible to convert the text type date data included in the record type to date type within the interface expression?
I would like to borrow your help. Thank you.

こんにちは、いつもありがとう。
今日は皆さんに相談したいことがあります。

インターフェースの式モード内で、レコードタイプからデータを取得し、そのデータを集計処理してグラフに表示する処理を試みています。
集計処理は月と年の単位です、2024年の各月の合計金額、のような形です。
練習のために仮のレコードタイプを用意しました。レコードタイプに含まれる対象のデータがすべて日付型の場合、実装は成功しました。

しかし、設計されたレコードタイプの中には、テキスト型で日付データを持っている項目があります。「2024/11/04」というような形のテキスト型データです。
私はこの項目の値を、取得から集計処理の間で日付型のデータへ変換したいと考えています。テキスト型であれば、todatetime()で変換を実現できるようです。

しかし、レコードタイプから取得したデータはこの関数では歯が立ちません。レコードタイプ型、あるいはレコードフィールド型となり、これらの型から日付型へ変換することはできないとエラーが出ています。

レコードタイプに含まれるテキスト型の日付データを、インターフェースの式内で日付型に変換することは不可能なのでしょうか?
お力をお借りしたいです。よろしくお願いいたします。

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    hi  could you use todate() function and check ?

  • thank you. A similar error occurred for todate(). There may be a problem with the way I write it. . .

    ありがとうございます。todate()の場合も同様のエラーになりました。私の記述の仕方に問題があるかもしれないです。。。

  • 0
    Certified Senior Developer
    in reply to misakib0705

    hi   could you share your code snippet? The way you are writing based on that we can check 

  • Thank you for your kindness.
    The "XX" part is the current text-type date.
    This is the scene where grouping is done in "a!aggregationFields()" within "a!queryRecordField()".
    I tried the following description.
    "field: a!forEach(
    items: 'recordType!○○.fields.××',
    expression: if(
    condition: fv!itemCount <= max(fv!itemCount),
    valueIfTrue: todate(fv!item),
    valueIfFalse: null
    )”

    Even if I tried to do something more simple like "field: todatetime(××)", an error occurred.
    It seems that some team members were able to convert it, and they executed the if statement outside of a!queryRecordType().

    I'm trying to follow suit, but I haven't been able to do it yet. Try hard a little more.

    If you find any problems in the above description, please let me know.
    Thank you for your time. Thank you.

    ご厚意に感謝いたします。
    「××」の部分が今回のテキスト型の日付です。
    これは「a!queryRecordField()」内の「a!aggregationFields()」の中でグループ化をする場面です。
    以下の記述を試しました。
    「field: a!forEach(
    items: 'recordType!○○.fields.××',
    expression: if(
    condition: fv!itemCount <= max(fv!itemCount),
    valueIfTrue: todate(fv!item),
    valueIfFalse: null
    )」

    もっとシンプルに、 「field: todatetime(××)」とした場合も、エラーとなりました。
    チームメンバーには変換ができた人もいるようで、a!queryRecordType()よりも外でif文を実行していました。

    私も倣って実現しようとしていますが、まだできておりません。もう少し頑張ってみます。

    もし上記の記述内に問題がありましたらご指摘ください。
    お時間をくださりありがとうございます。よろしくお願いいたします。

  • 0
    Certified Senior Developer
    in reply to misakib0705

    hi   aggregationFileds() could you please check this once and try this way and let me know please

  • thank you.
    "a!aggregationFields()" is working properly.
    docs.appian.com/.../fnc_scripting_a_aggregationfields.html

    We have confirmed that this function displays correctly when referring to a temporary record type (date data registered as a date type). I am using the same code as this time, and the problem is due to the record type data being a text date.
    Thank you.

    ありがとうございます。
    「a!aggregationFields()」は正常に機能しています。
    docs.appian.com/.../fnc_scripting_a_aggregationfields.html

    仮のレコードタイプ(日付型で登録された日付データ)を参照すると、この関数で正常に表示されることを確認しました。この時と同じコードを使用しており、問題はレコードタイプのデータがテキスト型の日付であることに起因しています。
    よろしくお願いいたします。