CSV Export process, using script

HI,

I have a requirement where I should make a CSV of proxyaddresses for today's leavers. The requirement is also that these addresses should not include "SMTP" -text and only "real" email addresses should be listed (not X500 etc)

Proxyaddresses are synched to a custom multivalue atribute on ADSAccount.

Problem is that as I have made the process automation to DialogDatabase table, to be able start it only once, I'm not able to pass the proxyaddresses to my script which will do the modification.

I also tried to make the script query today's leavers, but for some reason when using "where cast(exitdate as Date) = cast(getDate() as Date)" I get error message saying that "cast" is not valid.

And one more way I have tried to make process automation in ADSAccount and use the where clause there, but it ended to error as process is trying to write to same file from multiple processes...

So I have tried to do this in 3 different ways without luck.

Please help me.

I think maybe the easiest would be using the lineScript if it's possible somehow pass the ProxyAddresses to it, I haven't figured out the syntax. CCC_ListOfLeavers($$CCC_ProxyAddresses$$) is not it.