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
  • 0
    Certified Lead Developer

    By way of explanation to post above, a thing and a list of that thing are two entirely different datatypes.  When you cast a list as a singular datatype, Appian assumes that means you only want the first element in the single type.  That's why you can solve by enclosing the same type constructor in curly brackets, making a thing into a 1-length list cointaining that thing.

    I frequently have to do cast(typeof({1,2}), ri!input) to get integers, and not just an integer.

Reply
  • 0
    Certified Lead Developer

    By way of explanation to post above, a thing and a list of that thing are two entirely different datatypes.  When you cast a list as a singular datatype, Appian assumes that means you only want the first element in the single type.  That's why you can solve by enclosing the same type constructor in curly brackets, making a thing into a 1-length list cointaining that thing.

    I frequently have to do cast(typeof({1,2}), ri!input) to get integers, and not just an integer.

Children
No Data