Skip to main content
June 16, 2023
Question

process backed records, querying nested CDTs in the process model not working

  • June 16, 2023
  • 5 replies
  • 0 views

Hi all,

I have a nice process model, let's call it ProcessModel_A

The process model has a PV, of a CDT type. Let's call it CDT_A.

This CDT has some text and number attributes and also contains an attribute which type is a second CDT, let's call it CDT_B:

CDT_A:

   name - text - no multiple

   age - number - no multiple

...

   moreData - CDT_B - multiple

There is no database here, just the process models, and no Records, just CDTs.

Please, bear in mind that the moreData is a list.

I've created a Process backed record, RecordPM_A, of type ProcessModel_A.

When I run a query on the process, like:

a!queryRecordType (

  recordType: RecordPM_A,

  fields: {

     [RecordPM_A.fields.moreData.CDT_B]

...

when I query it like this, in the attribute moreData it keeps telling me that this is a list of text and is retrieving only the first element of CDT_B.

Any idea on how to FORCE it to understand that the list of elements is of a CDT type, not a text type?

Remember that I'm not defining the data types, this is a process backed record.

Thanks.

All goes well, but in the content of

    5 replies

    June 16, 2023

    I am not able to reproduce it. Does the list contains many elements? Does CDT_B have many fields?

    On the other hand, have you tried something like this? 1- queryRecordType returns only CDT_A 2- once you realized that you can see the CDT_B list, local!query.CDT_B to obtain your list. This is not the cleanest way to do it, but lets try it

    jordib623Author
    June 19, 2023

    Hi Jesus,

    thanks for your answer.

    Regarding your questions:

    - Yes, the list contains several elements.

    - CDT_B has several fields of different types

    Regarding your suggestion, sorry but I can´t see how I should articulate it.

    When I queryRecord CDT_A, i can store this in a local variable, which data type is automatically set by Appian.

    On it, local!query.CDT_B is not a list, is just a string variable containing the first element of CDT_B in a text array.

    As if Appian was failing to identify that CDT_B is a CDT list, and pulls all the info in a text variable comma separated.

    In Formatted view: [var1OfTheFirstElement=value, var2OfTheFirstElement=value, ...]

    So, its not identifying its content and not identifying it as a list.

    Appian Cloud installation v23.1.

    Process model first version created on 2010, current version 2023.

    peter.lewis
    Employee
    June 16, 2023

     I wasn't able to reproduce this either - Jordi if you have an application that consistently reproduces this, I'd suggest opening a support case.

    harshitb6843
    June 17, 2023

    How about removing that moreData from the CDT_A. Now because you already have CDT_B , you can just create 2 records and link them with 1:m relationship. Appian anyway does not recommend using nested CDTs

    jordib623Author
    June 19, 2023

    Hi Harshit,

    I should not modify the existing process models, as those are already working and the impact will not be affordable.