Hi, Please see attached document and readybloc. I am using a VAR to prompt me when there are multiple replacement properties in a file. Right now, I get a prompt whenever I render the document. How can I program the document that I should only get a prompt when there is more than one replacement property in the file? I tried doing it, but I still keep getting a prompt, even when I only have one replacement property in the file (see below).
<VAR $Counter (0)>
<VAR $Total (<COUNT {{.Property[{{.EscrowBriefLegal}}=”Replacement Property”]}}>)>
<IF ({{$Total}}=1)> {{.Property[{{.EscrowBriefLegal}}=”Replacement Property”].Address1Address2}}, {{.Property[{{.EscrowBriefLegal}}=”Replacement Property”].CityStateZip}}
<ELSE>
<FOREACH ASK {{.Property[{{.EscrowBriefLegal}}=”Replacement Property”]}}><VAR $Counter ({{$Counter}} + 1)><IF ({{$Counter}}>1)><IF ({{$Counter}}<{{$Total}})>, <ELSE> and </IF></IF>{{.Address1Address2}}<IF (Not IsEmpty({{.Block}}))>, Block {{.Block}}, Lot(s) <FOREACH {{.Lot}}><IF ({{.SortOrder}}=1)>{{.Number}}<ELSE>, {{.Number}}</IF></FOREACH>, </IF>, {{.CityStateZip}}</FOREACH></IF>
VAR Codings
VAR Codings
- Attachments
-
- my_RP_ForeachPropertyAddressWithB&L.doc
- ReadyBloc
- (19.5 KiB) Downloaded 57 times
-
- my_ExchangeDeclarationOfPerformanceRP_Buyer.doc
- Declaration of Perfomance
- (49.5 KiB) Downloaded 57 times
Re: VAR Codings
The code snippet you copied in is correct, and works as expected. The ReadyBloc file you uploaded, however, is different and does not include the <IF ({{$Total}} = 1)> conditional statement. Instead, the FOREACH ASK is a top-level construct so it would always be asked, assuming there was at least one qualifying object in the collection. I believe that if you replaced that ReadyBloc with the code snippet provided, you would get your desired result.
Re: VAR Codings
I tried replacing the readybloc with the other coding, however, it doesn't seem to work. I still get a prompt, even when there is only one property in the file. Please advise. Thanks.
Re: VAR Codings
Could it be coming from the other ReadyBloc referred to by the main document? Your original post only included one of the two ReadyBlocs, which I just verified does work when edited to include the IF conditional. Perhaps the other ReadyBloc contains similar coding that is now causing the prompt to occur?
If that still does not address your problem, please post the two ReadyBlocs in their most current state and I would be happy to evaluate them again.
If that still does not address your problem, please post the two ReadyBlocs in their most current state and I would be happy to evaluate them again.
Re: VAR Codings
Attached are to two readyblocs - The prompt is not coming from the second readybloc. It's coming from the first one. If you can help me figure out this issue, that would be great!!
- Attachments
-
- my_RL_PropertyAddressWithB&L.doc
- (19.5 KiB) Downloaded 53 times
-
- my_RP_ForeachPropertyAddressWithB&L.doc
- (20 KiB) Downloaded 46 times
Re: VAR Codings
Everything seems to be behaving normally on our end. What version of Select are you running?
Also, for debugging, place a {{$Total}} fieldcode in your ReadyBloc right after the <VAR> statement in which it is calculated just to see if the count is coming back correctly. If the variable is being set correctly, you should get a 1 when you have one property that meets the criteria.
Also, for debugging, place a {{$Total}} fieldcode in your ReadyBloc right after the <VAR> statement in which it is calculated just to see if the count is coming back correctly. If the variable is being set correctly, you should get a 1 when you have one property that meets the criteria.
Re: VAR Codings
I am using Version 2.3 and it's not working. Do you think that could be the issue? Please advise.
Re: VAR Codings
After doing a bit of research, it appears to have been an issue that was resolved in version 2.4. The problem stems from (needlessly) processing a FOREACH block inside the false part of a conditional statement.