Add constant to Record Formatter

Why is it only possible to add fields to table formatter and separators, but no string constants? I had to hack the following solutions, mass-writing the closing parenthesis to the Text8 field, which is not an elegant nor reliable solution:

Hi @fedoras,

You make very valid points. In fact, the ability to add static or constant values to a table format independent of a field is an existing request on GitHub: Support postfixes and static separators in table formats · Issue #6066 · specify/specify7 · GitHub.

I’ve commented with your report there and also added the UX tag to indicate that multiple users have encountered and requested this.

Thanks for reaching out!

:specify:

Hi @fedoras,

If you are willing to edit the XML, you can actually achieve this by using a sprintf expression. No need to waste a field! All that is missing is an option to configure something like this in the UI.

See below:

	<format name="CollectionObject" title="CollectionObject" class="edu.ku.brc.specify.datamodel.CollectionObject" default="true">
		<switch single="true">
			<fields>
				<field uifieldformatter="CatalogNumber">catalogNumber</field>
				<field format="(%s)">altCatalogNumber</field>
			</fields>
		</switch>
	</format>

Hi @fedoras,

This will be in 7.12.2!