Concatenate multi-values in a variable

Concatenate multi-values in a variable

I have an application where a Product must be assigned to one or more MarketSpaces. In a second form, I make notes about products and want to relate a Product, with a MarketSpace and Notes. For example, a Tivo is both a DVR and an HD-DVR and the note might say "Market leading DVR."

    To add MarketSpaces, I created a form to enter them.
    To add products, I set up the input form with a single line for product name and checkboxes for market spaces.
    To add a Note, I created a form that uses a PickList for the product. There didn't seem to be a way to integrate the two tables, so I added a hidden field for the MarketSpace that should be filled with the MarketSpace defined by the Product. Finally, there is a note field.



I want to have the market spaces update automatically so that if I initaially define a Tivo as both a DVR and an HD-DVR, I might in the future, want to add a market space like MediaCenter. I want to have a view that shows the Product name and the current MarketSpaces per product, but I am unable to get it to display properly. I only get the first value and not all values. What I need to do is interate through the set of multi-values.

If I do the following code snippet, I only get the first value.

t = Products [ProductName == input.ProductName];
set market_hidden = t.MarketSpaceLookup;


If I do something like the snippet below, I only get the last value.

r = Products [ProductName == input.ProductName];
for each MarketSpaceLookup t in r
{
set market_hidden = t.MarketSpace;
}






If I go back to the product form, both items are checked, so the values are being saved correctly.

How do I concatenate the multi-values into a single entry?

Is there a better way to view the MarketSpace field without having to add it to a hidden field (I don't think it will update dynamically).

Thanks.