Cast function not working properly

Hi ,

local!dataset: cast( 'type!{urn:com:appian:types}HistoryV', local!datamaster.data ) , I

n above code only first row is getting cast to new data type.

Ideally it should ocnvert whole dataset.

Kindly share your inputs on that . How can i convert whole dataset

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to sauravk

    That appears to work.  I've always been confused trying to use the "?list" approach, because when using the type! (and autocomplete) in Appian, it by default adds "()" at the end, which from your example would be like <<'type!{urn:com:appian:types}HistoryV?list'()>> - which works without the "?list" part added, but breaks when trying the list version.  It turns out that simply removing the "()" makes it work.  Thanks for posting the clarification.

Children
  • If it helps:

    'type!{urn}XXX_Type'() generates an INSTANCE of the type in question

    'type!{urn}XXX_Type' creates a REFERENCE to the type (e.g. for CASTing purposes)

    Adding the '?list' to the latter simply generates a DIFFERENT type (lists of a type are considered as a different types from the base type itself)

    In order to generate a list you can use the array modifier:

    {
        type!{urn}XXX_Type'() ,
        type!{urn}XXX_Type'() 
    }

    (this will create an array of 2 instances of the specified type, and the overall array is a different type from the members of the array)