Workflow with counting functionality

I am having trouble decribing what functionality I am looking to capture. In essence, I would like a
1 out of 4
2 out of 4
3 out of 4
4 out of 4

text at the bottom of a workflow order report. Does that make sense?

Solved Solved
0 25 674
1 ACCEPTED SOLUTION

I ended up creating a VC with this code. I needed to add another column because we sometimes have same people move in on different dates.

Count(select(vaults[unique_id],
and([contents_name] = [_THISROW].[contents_name],
[move_date] = [_THISROW].[move_date],
[_rowNumber]<=[_thisrow].[_rownumber])
))

View solution in original post

25 REPLIES 25

Are you trying to do this with the same Workflow as a page counter or are they different Workflows?

in essence they are the same. but it would be much better to have it separate from page number

so this is what the pdf generator looks like. i would like for it to say Vault 1 of 2
and on the next page Vault 2 of 2

Are you generating these with the Start: expression? How many pages you can have?

yes I am generating it with this start expression
<<Start:FILTER(โ€œvaultsโ€, ([contents_name] = [_THISROW].[contents_name]))>>

Why dont you push the expression into your template which will dynamically put the strings as you want . For instance,

Vault <<Count(FILTER(โ€œvaultsโ€, and([contents_name] = [_THISROW].[contents_name],[_rowNumber]<=[_thisrow].[_rownumber])))>> of <<Count(FILTER(โ€œvaultsโ€, ([contents_name] = [_THISROW].[contents_name])))>>

trying this now

im not validating expression, so please adjust it accordingly.

Before you run template with this expression, please test them one by one within virtual column on the source expression. Once vc returns true, then it could work on the template.

1st expression you need to test

Count(FILTER(โ€œvaultsโ€, and([contents_name] = [_THISROW].[contents_name],[_rowNumber]<=[_thisrow].[_rownumber])))

2nd expression

Count(FILTER(โ€œvaultsโ€, ([contents_name] = [_THISROW].[contents_name])))

almost there. but it doesnt seem to be advancing the first number, just sticking with the one value for everything

I supposed you have one set of data per page rather than showing multiple set of data per page.
you have start/end expression, then you insert page break. Then you should have one set of bar code per page and each page should have Vault xx of xxx numbering.

If you want to display mutiple set of data per page, then my suggestion will not work.

no one set of data per page
the del friscos image is inaccurate, I have a page break. But now that you mention it. Where does the page break go, before or after the end expression. I seem to always have 1 blank page at the end

Where do you currently place the page breaker on your template?

โ€œ<<[barcode]>>โ€
page break
โ€œendโ€

Try insert page break after << End >> expression.

the first expression is still just using the same number. Do i have to do another start expression within the first one?

What is the name of id field for vaults table?

the key field is called unique_id

its an 8 number/letter string

<<Count(select(vaults[unique_id],and([contents_name] = [_THISROW].[contents_name],[_rowNumber]<=[_thisrow].[_rownumber])
))>>

What happen if you change first expression into this?

or is it possible your data source is sitting on SQL rather than Spreadsheet?

its on google sheets now, but I will be converting it to MySQL once I finish

Then you need to avoid to use _rownumber expression.

Anyway, to debug, you firstly test if the expression yield the desired number by pushing the exression into source table.

Does this expression does that job, or yielding the same / repeating number?

Count(select(vaults[unique_id],and([contents_name] = [_THISROW].[contents_name],[_rowNumber]<=[_thisrow].[_rownumber]

I ended up creating a VC with this code. I needed to add another column because we sometimes have same people move in on different dates.

Count(select(vaults[unique_id],
and([contents_name] = [_THISROW].[contents_name],
[move_date] = [_THISROW].[move_date],
[_rowNumber]<=[_thisrow].[_rownumber])
))

Top Labels in this Space