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

  • 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.
  • Hi Anusha,

    1) As per my understanding we have "User" Appian data type (i.e available only as RI's/AC's/PV's not as CDT elements types) there is no "Users" appian data type.
    2) We can clearly observe that You have added a "Users" CDT as a Nested CDT to the Main cdt.

    To store the User value.
    1) You need to create a text field in CDT(requestor_cdt) and store it directly.
    2) Create a Rule input with "User" type and store it and then map to cdt text field
    3) In Your Case. In the Interface , store it in Nested CDT field ( requester_cdt.Users.UserName)

    Thanks