Page 1 of 1

HTML ReadyDoc loop index

Posted: Thu Jul 25, 2019 4:10 pm
by kkirkfield
In my ReadyDoc I'm looping over a collection using a section. I'm then using IronPython to store and increment the index that I use in the doc.

Code: Select all

{{# .Root.Buyers}}
    {{& GetBuyerIndex}}]
    {{& IncrementBuyerIndex}}
{{/}}
Is there a better way to do this, possibly using some built-in function or construct? Handlebars syntax mentions {{@index}} but that doesn't seem to work.

Re: HTML ReadyDoc loop index

Posted: Tue Aug 06, 2019 10:54 am
by brandon.ritchie
{{# .Buyers.Count}} will give you how many buyers are on an order. Also for buyer or any contacts you can use the {{.Code}} to know which one it is. For buyers the 1st code is B, then B2, B3 and so one. It would depend on what you are trying to do with this index to know if you need to track that in python or not.