Page 1 of 1

{{.Self}} use

Posted: Thu Nov 09, 2023 5:13 am
by cklahr
Hi,

Where is the {{.Self}} field located? and what purpose does it serve? I noticed it on documents and am wondering how I can identify or utilize it.

Thank you so much!

Re: {{.Self}} use

Posted: Thu Nov 09, 2023 12:14 pm
by vmrvichin
{{.Self}} references the type being generated. For example if you have a readybloc holding exceptions that could apply to a number of documents (policies commitments) the {{.Self}} field can be used to test the type <IF ({{.Self}}="Commitment")> and only apply that exception if the document type is a Commitment.

It can also be used as a sort of 'where am I check' at any point in the document, such as within a for loop it can tell you what field/multiple you are on in there.

Re: {{.Self}} use

Posted: Tue Nov 14, 2023 6:54 am
by cklahr
Thank you so much for the explanation!