Is it possible to use variable in CHelper.GetValueAsCollection method?

I have a collection with name Offers.

I try to get row from this collection with specific variable (OfferId), and store collection size (for testing purposes) to the 1 row, but collection return 0 size.

  1. var OfferId = "1431";

    var Offers;

    Offers = CHelper.GetValueAsCollection(<Collection_test.Offers[Offer_id = OfferId]>);

    //this row just for testing purposes

    Me.setXPath("Collection_test.Offers["+ 1 +"].Weght", Offers.size());

    for (var i = 0; i< Offers.size(); i++) {

    var OfferCollection = Offers.get(i);

    OfferCollection.setXPath("Offer_status", 1);

    OfferCollection.setXPath("Weght", 0);


Comments (1)


Dear Alexandr,

Iterate over XPath allows you to carry out iterations (or cycles) over a collection XPath, that is, a one-to-many relationship:

Get value as collection: Transforms a list of values stored as a text chain into an array list. In some cases, it is necessary to handle Collections in expressions without using the Iterate over XPath functionality to allow a complete manipulation of the code.

Count function: Counts the number of elements in a collection.For example: Returns the number of approved products in the Request.

var ProductNumber = <count(Request.Products[Approved= true])>;

Totalizers are aggregate functions applied to table columns in order to obtain a unique value, which will be shown at the bottom of the column. They are only meant as a display option (storing the totalizer is not currently possible).

The function Count: Returns the total number of records in a column (row count).

For more information:

You can find an option for an attribute to be displayed and stored, in this example the sum function is used, but there is also the count function: in / index.html? store_the_total_value_of_a_col.htm

Hope this information might be useful for you.

Best regards.