Page 1 of 1

Querying Source Template Field Code?

Posted: 13 Nov 2021 01:46
by BEJ
When creating custom source template definitions I added some of my own template fields. There is one field that I want to appear in every source record I create with each custom source template. Is it possible to find a specific Source Template Field Code when querying sources? I can get a result using field numbers (%SOUR._FIELD[1]%, %SOUR._FIELD[2]%, %SOUR._FIELD[3]%, etc.) but the Source Code I want to see appears in different places in each custom template definition so that doesn’t seem like the right approach.

The end result I want is to create a list of all sources that have “x” text in in a specified custom Template Field.

Is there a way to accomplish this by adding fields that could be searched elsewhere, perhaps?

Re: Querying Source Template Field Code?

Posted: 13 Nov 2021 10:07
by tatewise
Yes, see the Help page on Understanding Data References.
At the bottom under Data References And Metafields it explains how to compose shortcuts with the metafield name.

Those shortcut metafield references can be used anywhere in Expressions just like most other data references.

Re: Querying Source Template Field Code?

Posted: 14 Nov 2021 20:20
by BEJ
Perfect. Thanks, Mike.

I think I have a handle on working with metafields. On a related issue, I've been experimenting with trying to use SOURce data references in my custom source template definitions (e.g., %SOUR.REPO%) so that I don't have to create a duplicate metatag fields (e.g., {Source_Repository}). I haven't quite got that figured out. Any advice?

Re: Querying Source Template Field Code?

Posted: 14 Nov 2021 21:26
by tatewise
See Adding Citation information to Templated Sources (18646), which I think gives enough clues.
If not, then PLEASE start a new thread on this new topic.

Re: Querying Source Template Field Code?

Posted: 14 Nov 2021 21:56
by BEJ
Thanks. I read that thread a couple of times before posting (as well as FH help). Will go over it again to try to find the parts that apply.

Re: Querying Source Template Field Code?

Posted: 14 Nov 2021 23:36
by BEJ
I was so close--found my mistake. Thanks again.