If conditionals in sentence templates

My ancestors always owned land, so the Property fact is used a lot in my tree. They always owned the same villages, so for example the village “Buslar” was owned by at least 30 different people. I don’t want to type the same information about this village so many times. My idea, to save work, was to set the fact sentence template that checks if the Description is “Buslar”, and if so, adds " (population:379)". I would also want to do this with several other properties.

I can’t think of a way to do that.

That would require enhancement to the Sentence template language to support switches conditional on a variable’s value.

Manteuffel, Perhaps you could try this : use the Place field (rather than Description) to record “Buslar” and then use Place Details to add “(population:379)”. Then write your fact sentence around these two fields. Would that help cut down on repeatedly re-typing the same thing?

Thanks for the idea!
However, I was searching for a solution that doesn’t involve repetitive copy and pasting.

I think my suggestion does that, I’ve tested it and it seems to work! Enter “Buslar” in the Place field and “(population:379)” in Place Details for one person. When you save that, RM will then store both so you can use them again with other individuals. Start typing “B” in the Place field for the second individual you want to associate with that place and you’ll be presented with a drop-down list that includes “Buslar”, just click on that and you’ve got it. In the same way, in Place Details start typing “(” and you’ll see “(population:379)” in the drop-down. Because each Place has its own list of associated Place Details, “(population:379)” is automatically linked to “Buslar”.

1 Like

Thank you!
I forgot that you don’t have to type the full Place and PlaceDetail. I will use this. (assuming RootsMagic doesn’t randomly add conditionals in sentence templates)