Hello, I have an issue wherein I am running a report within a model a

Hello,

I have an issue wherein I am running a report within a model and saving the report output to a cdt. One of the report columns is a multi-value pv, but if I set up my cdt node to store multiple values, I can't save the report output to that node, and if I set up my cdt node to only store single values, only the first value of the multi-value pv is saved in that cdt node. I've tried some combinations of using the joinarray function within the apply function, but this isn't helping. Any help with this would be greatly appreciated.

Thanks,
Dylan...

OriginalPostID-67387

OriginalPostID-67387

  Discussion posts and replies are publicly visible

  • You can try joinArray() method to convert a array to a string. This is one option
  • Right, but when I do that, it joins the outputs of all report rows into one row in the cdt, even though I have the data output node operator is set to "append to list." When I tried to use the joinarray() function within the apply() function, I only got the first result of the array.
  • OK, I get it. Your analytics node returns an array of data. But not an array of arrays. This is where the issue lies. What you need to do is take the array value returned by the analytics node for this column, iterate through each of these (they will type string), and tokenize them into an array. It'd be interesting to understand what you are trying to achieve. The other option is to store the data in a one-to-many table relation in the database and fetch is straight from the DB. If you want to establish some kind of relationshop between the data in Appian and your database entities, you can use a reference key that you can fetch via the analytis node and go to the DB with that data to get you the result set. Comparitively straight-forward and scalable than iterating through values and tokenising strings into arrays.
  • Storing the data in a database is not an option for us. Basically, what I'm doing is running a report that lists active process instances and their tags (basically, ad-hoc instance classifications and the multi-value pv) for saving in a cdt and displaying in a paging grid for the user to select instances for which they'd like to update tags. So, for each instance (row in the report), I'd like to save in a cdt the instance id, the instance name, and the list of tags that apply for that instance.
  • I just came up with a workaround where I used the joinarray() function in the report definition itself. This seems like it will work.
  • Give the functions externalize/internalize a try.

    I have some models that have a PV of type CDT as well as a PV of type text. Whenever I change data in the CDT I externalize the CDT to the text PV.

    To get the data into another process I use a report which has a text column for the text PV and use it in a "Execute Process Report" node. Then I internalize this into a PV of the same type as the CDT.

    This even works for different versions of a CDT when you have older running instances of a process. In this case fields are mapped by name.