Question

Using $count on projection set in Workflow (BPA)

  • 2 May 2023
  • 5 replies
  • 106 views

Userlevel 7
Badge +21

For each set of a projection we can request something like:

[YourServer]/v1/CurrencyRatesHandling.svc/CurrencyRateSet

This will give a list of all the currency rate sets. Great. One of the query parameters is $count (see [YourServer]main/ifsapplications/projection/v1/CurrencyRatesHandling.svc/$openapi?V3#tag/CurrencyRateSet).

How do I use this on the URL as mentioned?

This is my first step to understand how to implement retrieving the number of rows in a set retrieved via something like the following:

It comes down to knowing in the end, are there zero or more rows. Based upon the count I can perform another step in the process.


5 replies

Userlevel 7
Badge +21

Answer found for the OData issue on count. That would be:

[YourServer]main/ifsapplications/projection/v1/CurrencyRatesHandling.svc/$openapi?V3#tag/CurrencyRateSet?$count=true

the available number of rows is shown with the available data.

Leaves open how to implement $count in workflow.

Userlevel 7
Badge +21

Although not tested, I think that this hints to the answer:

https://docs.ifs.com/techdocs/22r1/040_tailoring/500_business_process_automation/050_business_process_modeling/020_ifs_projection/#skip_option

It shows how to skip a number of rows while reading using a projection:

Including Key - $count and Value - true would make sense, but not sure where the count is left.

Userlevel 7
Badge +21

Tried to pass $count as Key but during inspect no %count% value appears. So it doesn't seem to be a solution to where to retrieve the number of rows read for a set.

Anyone an idea?

Badge +1

@eqbstal Hi, did u find the solution for this in the meanwhile? Or would it be possible to create a script task to find the amount of items in the entity set/collections?

Thanks 

Userlevel 3
Badge +5

workflow does not support $count option yet. 

You can use a script task for this purpose  

 

Reply