* Querying Source Template Field Code?

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
BEJ
Famous
Posts: 196
Joined: 10 Sep 2018 17:29
Family Historian: V7
Location: Boston, Massachusetts, USA
Contact:

Querying Source Template Field Code?

Post by BEJ » 13 Nov 2021 01:46

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?

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Querying Source Template Field Code?

Post by tatewise » 13 Nov 2021 10:07

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
BEJ
Famous
Posts: 196
Joined: 10 Sep 2018 17:29
Family Historian: V7
Location: Boston, Massachusetts, USA
Contact:

Re: Querying Source Template Field Code?

Post by BEJ » 14 Nov 2021 20:20

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?

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Querying Source Template Field Code?

Post by tatewise » 14 Nov 2021 21:26

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
BEJ
Famous
Posts: 196
Joined: 10 Sep 2018 17:29
Family Historian: V7
Location: Boston, Massachusetts, USA
Contact:

Re: Querying Source Template Field Code?

Post by BEJ » 14 Nov 2021 21:56

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.

avatar
BEJ
Famous
Posts: 196
Joined: 10 Sep 2018 17:29
Family Historian: V7
Location: Boston, Massachusetts, USA
Contact:

Re: Querying Source Template Field Code?

Post by BEJ » 14 Nov 2021 23:36

I was so close--found my mistake. Thanks again.

Post Reply