Iterating through {{Order.Buyers.People}}
Posted: Thu Aug 27, 2020 2:38 pm
Hi everybody,
I'm trying to concatenate a list of names and titles for all people involved with an organization who is the buyer/borrower, but I can't seem to get it to iterate through the {{Order.Buyers.People}} collection in the ReadyDoc. I can do it in the Formula Editor, but not here.
The purpose of this code is to construct the $Names variable, and to be able to use it elsewhere in the document. I try to construct it by looping through the {{Order.Buyers.People}} collection, but when I check the values of $Counter and $PeopleCount, they're both returning zero. What am I doing wrong? Thanks!
I'm trying to concatenate a list of names and titles for all people involved with an organization who is the buyer/borrower, but I can't seem to get it to iterate through the {{Order.Buyers.People}} collection in the ReadyDoc. I can do it in the Formula Editor, but not here.
Code: Select all
<COMMENT> PC {{Order.Buyers}} </COMMENT>
<VAR $Names (“”)>
<VAR $Counter (0)>
<VAR $PeopleCount (0)>
<FOREACH ({{.People}})>
<VAR $PeopleCount ({{$PeopleCount}} + 1)>
</FOREACH>
<FOREACH ({{.People}})>
<VAR $Counter ({{$Counter}} + 1)>
<IF ({{$Counter}} = 1)>
<VAR $Names ({{.FullName}} + “, its “ + {{.Title}})>
<ELSE>
<IF ({{$Counter}} = {{$PeopleCount}})>
<VAR $Names ({{$Names}} + “; and “ + {{.FullName}} + “, its “ + {{.Title}})>
<ELSE>
<VAR $Names ({{$Names}} + “; “ + {{.FullName}} + “, its “ + {{.Title}})>
</IF>
</IF>
</FOREACH>