Using workflow variable in powershell script in PowerActivity

Mar 2, 2009 at 10:25 AM
Hi all,

I am new to this forum and new to SharePoint.

I have developed one custom action that returns dataset. Now I want to access the rows and columns in this dataset for which I am using SharePoint Designer PowerActivity V1.2. So, I have workflow variable declared of type System.Data.DataSet through ACTIONS file and want to use this workflow variable in powershell script. But powershell is not recognizing this workflow variable. It treats it as new dataset. So, data is lost. Could you please help me in this?

Thanks in advance,
Rashmi
Coordinator
Mar 3, 2009 at 8:39 AM
Hi,

unfortunately, I think that will  not work, because the SharePoint Workflow Designer UI doesn't support System.Data.DataSet as WF variable.
But you can do your query within the PowerShell script.
SharePoint Designer isn't a great Workflow Tool recommend you Nintex Workflow 2007.

Bye,
Christian
Mar 3, 2009 at 9:27 AM
Thanks for the reply.
We will check out Nintex Workflow 2007 as suggested.
We have tried use of DataSet in custom actions as below:
  1. Created one custom action that returns dataset. So, ACTIONS file has System.Data.DataSet as "out" parameter. When we checked workflow variables in sharepoint designer, this variable was listed in "Workflow Local Variables" with the type as System.Data.DataSet.
  2. Then we created another custom activity that takes DataSet as "in" parameter and then processes this dataset.
To get this working, we added System.Data dll's entry in authorized types section in web.config.
Then we were able to pass DataSet from one custom action to another. But then this makes our first custom action useless without second one. What we want is to extract data from dataSet in sharepoint designer itself. As PowerActivity makes it possible to deal with datasets, we tried to use it. But it was unable to recognize workflow lookup variable of dataset type. Is there any other way to make use of DataSet or any other collection types in sharepoint designer itself?

Thanks,
Rashmi
Coordinator
Mar 3, 2009 at 9:06 PM
Hi,

unfortunately you will not be able to use your dataset variable with the builtin SharePoint designer actions.
One option could be working with the DataSet as a XML string (dataset.GetXml()). So you have just a string.
After that you need to query the xml string. Take a look at my SharePoint Designer Activities. There is an query xml action included.

Bye, Christian