How to fix error: Could not cast from User to Users - when there is only one Appian data type called "Users"?

 How to fix error: Could not cast from User to Users - when there is only one Appian data type called "Users"?

Not sure how it determines the new user type of singular form "User" and why it cannot cast. Please advice how to fix this.

Thank You

 

  Discussion posts and replies are publicly visible

Parents
  • Hi Anusha,
    Please correct me if I'm wrong. I have gone through all the above comments.
    As per my understanding, A CDT field types can be of Primitive or Custom data type. Other appian object types are not allowed.
    So I think your CDT must have a Text data type to store the User name, this is same as Document. when we want to store the document and we use to take the Number(Integer) type like wise to store the User we can take text data type and we can type cast using toUser() function.
    In your code you took max selection as 1 so you wont face any issue here.
    Could you please provide us the field type of your ri!NSARequest.Requestor
    I think the Users data type is not a primitive data type. It might be a CDT. All the primitive data types present under the name space
    www.appian.com/.../2009 please check your Users data type Name space.
Reply
  • Hi Anusha,
    Please correct me if I'm wrong. I have gone through all the above comments.
    As per my understanding, A CDT field types can be of Primitive or Custom data type. Other appian object types are not allowed.
    So I think your CDT must have a Text data type to store the User name, this is same as Document. when we want to store the document and we use to take the Number(Integer) type like wise to store the User we can take text data type and we can type cast using toUser() function.
    In your code you took max selection as 1 so you wont face any issue here.
    Could you please provide us the field type of your ri!NSARequest.Requestor
    I think the Users data type is not a primitive data type. It might be a CDT. All the primitive data types present under the name space
    www.appian.com/.../2009 please check your Users data type Name space.
Children
No Data