1. Home
  2. Docs
  3. Data Source Expressions
  4. Dynamic data sources

Dynamic data sources

A dynamic data source is a data source that uses one or more variables in an expression instead of hard-set values, which makes it possible to dynamically retrieve data.

Dynamic data sources offer a solution for users who need to get the resulting data based on selected conditions.


Examples:

The user selects the products based on the stock in the operation. The user selects the warehouse in the operation header, it is logical that the selection displays the remains of only the selected product and only for the selected warehouse.

We set up a report showing cash flow information for the period. Of course, when changing the period in the report form, it is necessary to extract and display the data set corresponding to the user’s choice.


Dynamic data sources can used by Hubcloud for the following tasks:

  1. In Operations:
    • Create a dynamic list based on selection. For example, create a list of products of the selected group
    • Automatically fill the table based on selected criteria ( see more: “Table Fill” and “Pick up”  )
    • Retrieving User-Selected Values
  1. In Reports:
    • Filter by period
    • Filter by Catalogs

Variable Format

When using dynamic data sources in Operations, variables are set in the format:

  • $h.fildName – value in the fieldName field of the operation header (” h ” means header).
  • $r.fildName – value in the fieldName field of the operation table (“ r ” means row).

Example:

Product | Store($h.store) | Product($r.product) | GroupBy(product, quantity, amount) | Compute(price, amount/quantity)


When using dynamic data sources in Reports, variables are set in the format:

  • &filterName – the filter name to which the report selection value will be passed.

When setting up a report, the following values are used to select a period:

  • &dateStart – Period Start Date
  • &dateFinish – Period End Date
  • &dateStartPreviousDayEnd – End of day preceding start date of period
  • &dateFinishPreviousDayEnd – End of day preceding end date period

The &dateStartPreviousDayEnd and &dateFinishPreviousDayEnd parameters are used when you need to get balances on a date, not including the specified date. For example, you need to get the balances at the beginning of the period, but not including records in which the period is equal to the start date of the period.

Example:

Money | Period (& dateStart, & dateFinish) | СompanyAccount (& account) | GroupBy (CompanyAccount, Amount) | GetTitle ()

This expression retrieves entries from the Money Register for the period between the &dateStart and &dateFinish values set in the report form. In addition, the selection is set according to the CompanyAccount column according to the values selected in the &account filter.