Linking Outputs within a Formula

Hi TB Community,

What would be the right way to link/end the formula below?

Ideally there would also be a way to add a "+" or "," between the different outcomes (if there is more than one available)

Also - it would be amazing to alter the text after, to be plural/singular, based on the amount of documents available:

  • Please make sure you have reviewed that/them and are okay with accepting/assuming before signing your offer.

  • These/This document(s) are available under the "Property Documents" section. You will have to create a profile to download those/that document/s."

image

Thank you!!

Hi there!

I wonder if it would be easier to use Text Blaze's if/else command here. You can create if statements that make specific text to show up when certain circumstances are met within your snippet. I think that could be an easier solution.

Here's an example:

{note}Singular/Plural: {formmenu: default=Singular; Plural; name=singular/plural}{endnote}

{if: `singular/plural`="Singular"}This document is{elseif: `singular/plural`="Plural"}Those documents are{endif} available under the "Property Documents" section. You will have to create a profile to download {if: `singular/plural`="Singular"}it{else}them{endif}.

Please let me know if you have any questions.

Thanks for the response Dylan! I guess my main question is more about how to spit out those results:

"POS"
"Lease(s)"
"Rent Roll"

With a "+" or "," between them, if there is more than one document that is to be inserted/available.
And without anything after it, if only a singular document is available.

I would be inserting my previously attempted formula where "diffdocs" is inserted in the snippet below:
image

And then, if possible, it would be great to have that same portion/identifier/code which adds the "+" or "," in between the multiple documents, also determine whether the rest of the description should be plural or singular.

Thank you :grinning:

Would something like this work?

{note}Docs: {formmenu: POS; Lease(s); Rent Roll; name=diffdocs; multiple=yes}{endnote}

{if: includes(diffdocs, "POS") or includes(diffdocs, "Lease(s)") or includes(diffdocs, "Rent Roll"); trim=yes}

  • The {=join(diffdocs, ", ")} for this property {if: count(diffdocs)>1}are{else}is{endif} available.
  • Please make sure you have reviewed {if: count(diffdocs)>1}them{else}that{endif} and are okay with accepting/assuming before signing your offer.
  • {if: count(diffdocs)>1}These documents are{else}This document is{endif} available under the "Property Documents" section. You will have to create a profile to download {if: count(diffdocs)>1}those documents{else}that document{endif}.{endif: trim=yes}
1 Like

Dylan- Thank you so much for making that! I forgot to mention that those variables are being read from a Datablaze table:
image

@ajduna7 Please try this one and let me know if it works for you.

join([text for text in ["POS" if `pos available` = "yes" else "", "Lease(s)" if `Lease Available` = "yes" else "", "Rent Roll" if `Rent Roll Available` = "yes" else ""] if text<>""], ", ")
2 Likes

That worked perfectly- Thank you Abdalla :grinning:

1 Like