I've researched this on the site and gathered what I have here but still cannot seem to grab more than a single value from a multivalue token. In the workflow, I have a token setup with the box checked to accept multiple values, and I use the suggested GetTokenAsMultiValue statement, and then iterate through the list it is applied to. One value, every time. This is what I have in the script:
namespace WorkflowActivity.Scripting.SDKScript
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Laserfiche.RepositoryAccess;
using System.IO;
using System.Collections;
using Laserfiche.RepositoryAccess.Common;
using System.Linq;
public class Script1 : RAScriptClass91
{
protected override void Execute()
{
StreamWriter csvWriter = new StreamWriter("C:\\Program Files\\Laserfiche\\Laserfiche Workflow 9\\MaryPoppinsDumbHead.csv");
string headerRow;
string dataRow;
StringBuilder csvData = new StringBuilder();
List<string> rowsList = new List<string>();
headerRow = "Company Name, Renewal Date, Notice Date";
csvData.AppendLine(headerRow);
csvWriter.WriteLine(headerRow);
dataRow = "";
string jackoe = TokenReplace("%(DataResultsCounter)");
int jacko = Convert.ToInt32(jackoe);
List<object> values = this.WorkflowApi.GetTokenAsMultiValue("newName2");
foreach (string result in values)
{
rowsList.Add(result);
dataRow = result;
csvData.AppendLine(dataRow);
csvWriter.WriteLine(dataRow);
}
csvWriter.Flush();
csvWriter.Close();
csvData.Clear();
}
}
}
Can anyone help with this please?