Skip to main content
pankajm0004
New Participant
Aug 25, 2021 8:09 AM UTC
Question

Fetching values from record type into local variable

I am working on a requirement where I need to show the read only grid to the user and user will be able to filter the data. I need to show the sum of filtered column values also to the user.

I was trying to cast the record type to CDT in the following way but it was showing castInvalid:

cast(
 typeof('type!{urn:com:appian:types:INV}CDT_NAME'()),
  recordType!recordName
)

4 replies

vinayp0002
Participating Frequently
Aug 25, 2021 9:35 AM UTC

Hello Pankaj,

You can cast in the following manner:

'type!{urn:com:appian:types:INV}CDT_NAME'(

field1: rv!record[recordType!recordName.field]

)

pankajm0004
New Participant
Aug 25, 2021 9:55 AM UTC

Hi Vinay,

We cannot use rv!record inside rule. It gives the error - Could not find variable 'rv!record'

vinayp0002
Participating Frequently
Aug 25, 2021 9:57 AM UTC

This is specific if you are trying to create a record type and passing the cdt to your interface.

peter.lewis
Employee
Aug 26, 2021 1:37 PM UTC

I'm unclear what you are trying to do - it shouldn't be necessary to cast a records grid to a CDT to show what you need. Can you describe more about your use case? What is the expression for your grid? Can you give an example of showing "the sum of filtered column values" in you grid?