Answered

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)

photo
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: https://help.bizagi.com/bpm-suite/en/index.html?iterate_over_xpath.htm

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.

https://help.bizagi.com/bpm-suite/es/index.html?obtain_and_use_entity_values.htm

http://help.bizagi.com/bpm-suite/en/index.html?xpath_advanced_functions_examp.htm

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:

http://help.bizagi.com/bpm-suite/en/index.html?grid_totalizers.htm

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: https://help.bizagi.com/bpm-suite/ in / index.html? store_the_total_value_of_a_col.htm

Hope this information might be useful for you.

Best regards.