Skip to main content
Known Participant
June 1, 2022
Question

Create any type variable in a process

  • June 1, 2022
  • 8 replies
  • 9 views

Hi!  I read it isn´t possible to create an any type variable in a process. This is my use case, I hope you can help me:

I need to pass a process an array of cdt, but it could be different types of cdt, and the process, depending of the cdt type writes on a different table.

Any idea is welcomed, thanks!

8 replies

stewart.burchell
Employee
June 1, 2022

You could use a Map() type to hold an array of different arrays of CDTs).

Known Participant
June 1, 2022

This was my first guess but I need the type of my cdt to determine the table to write

Known Participant
June 1, 2022

I think I resolved it, with typeof() i get the type of the CDT in a number, then i pass to the process a text variable with the value ToJson(pv!mycdts) and typeof number. In the process with a script task I do cast( typeofnumber , fromJson(pv!mycdts))

harshj0001
Inspiring
June 1, 2022

You can use "type!" more, eg.

I am casting local!lookUp_cdt into SOM_Lookup'() type. You can copy and pate into your rule and change the CDT name accordingly. Hpoe it will help.

local!lookUp_cdt : 'type!{urn:com:appian:types:SOM}SOM_Lookup'()

New Participant
August 19, 2022

You can create a process variable of type datasubset, save the values to this process variable and cast it to of required cdt type based on your need

harshitb6843
Brainy
August 19, 2022

This is a 3-month-old post. And we have a better data type now - a!map() [emoticon:41d3875e132d40cdaee3dc767007b788]

New Participant
February 29, 2024

Can you please explain more about this.