Collection Member to Collection String script inside bridge parameter. How can retrieve all member name separately when I select all value either for token or check box.

Here is my code to retrieve the value.
CollectionMemberValue memberValue = (CollectionMemberValue)$input$.Resolve();
var commaDelimitedString = string.Empty;
var ParentName = string.Empty;
var big = string.Empty;
List valueList = new List();
//Pass “All” string if user selected “All” checkbox or “All” token
if(memberValue.Token != null && memberValue.Token == PredefinedToken.All )
{
commaDelimitedString = “All”;
}
else
{
for (int i = 0; i < memberValue.Values.Count; i++)
{
if(memberValue.Values[i].ParentMemberUniqueName != null)
{
ParentName = memberValue.Values[i].ParentMemberUniqueName;
var ParentNameToDel = ParentName.Substring(0,ParentName.Length-2);
commaDelimitedString = memberValue.Values[i].UniqueName.Replace(ParentNameToDel+".","").Replace("."+memberValue.Values[i].LevelUniqueName,"");
valueList.Add(commaDelimitedString);
}
else
{
commaDelimitedString = memberValue.Values[i].UniqueName.Replace("."+memberValue.Values[i].LevelUniqueName,"");
valueList.Add(commaDelimitedString);
}
}
}
return new CollectionStringValue($id$, valueList);

Using the above script I can achieve this.

But when I select All either using checkbox or token I get nothing. I want a separate list for all selection. Please suggest.

This topic is currently being consulted offline by Dundas Support. We will post the solution when it is available.

Hi Anupam,
The code below will return “All” or the list of selected values if they are not all selected:

CollectionMemberValue memberValue = (CollectionMemberValue)$input$.Resolve();
var commaDelimitedString = string.Empty;
//Pass “All” string if user selected “All” checkbox or “All” token
if (memberValue.Token != null && memberValue.Token == PredefinedToken.All)
{
commaDelimitedString = “All”;
}
else
{
for (int i = 0; i < memberValue.Values.Count; i++)
{
if (commaDelimitedString.Length == 0)
{ //Need to strip off appended level unique name…
commaDelimitedString = memberValue.Values[i].UniqueName.Replace(".A", “”);
}
else
{
//concatenate all selected values to a comma-delimited string
commaDelimitedString = string.Format("{0},{1}", commaDelimitedString, memberValue.Values[i].UniqueName.Replace(".A", “”));
}
}
}
return new SingleStringValue($id$, commaDelimitedString);

I hope this helps. Even if it would be better to have the list of all the values when “All” is selected, for now it’s the only way to deal with it that I’ve found. Just test if the string equals “All” or not, and if yes then adapt your code to deal with all the values.
Best regards,
Olivier Romero