Sentence template value switch not giving the expected result

I have the following sentence template: [Newspaper], [PubPlace], [IssueDate], <[ItemType], >< [SpecificContent], ><[Website], ><<?[ImageURL]|[ImageURL]|[URL]> : ><[AccessType] ><[AccessDate]><. [Annotation]>.

For this part of it: <?[ImageURL]|[ImageURL]|[URL]> I want to display the value of [ImageURL] if it has a value, otherwise display the value of [URL]

This is what I am getting:
Bulletin de L’association Française Contre L’abus Du Tabac et des Boissons Alcooliques, Paris, France, April 1881, temperance activities of Thomas Pattison, MyHeritage.com, [ImageURL] : downloaded 29 July 2023.

In this case [ImageURL] has no value. What I want is:
Bulletin de L’association Française Contre L’abus Du Tabac et des Boissons Alcooliques, Paris, France, April 1881, temperance activities of Thomas Pattison, MyHeritage.com, https://www.myheritage.com : downloaded 29 July 2023.

OK, I just tried it with a value plugged in for ImageURL and it works correctly in that case:
Bulletin de L’association Française Contre L’abus Du Tabac et des Boissons Alcooliques, Paris, France, April 1881, temperance activities of Thomas Pattison, MyHeritage.com, https://gallica.bnf.fr/ark:/12148/bpt6k122159n/f51.image : downloaded 29 July 2023.

What am I missing?

I’m going to report this as a RM9 bug. I happened to make a slight change to [SpecificContent] and it suddenly displayed correctly. [ImageURL] was a newly added field, and I think that might have something to do with it.

That is the case for any source or citation created before the new variable was added. The new field is missing from the stored data for source or citation as the case may be and will get added, even as an empty field, when the corresponding source or citation is next edited. RM behaviour has always been to output the field name from the sentence template when the field is missing from the XML data.

RM Inc has been repeatedly requested to change the output behaviour to output nothing in place of the field name missing from the data.

1 Like

OK, thanks. I hope they fix that in RM9. If you put a field that is not in the source template into a sentence, then it makes some sort sense to me to display the field name, because, presumably you have an error and need to remove it from the sentence. But if the field is defined for the template, it should never display the field name instead of an empty value.