Identifying Variable Values

This forum is for Single-Sourcing your Flare content to multiple outputs.
Post Reply
andy_smith
Propeller Head
Posts: 24
Joined: Wed Jun 16, 2021 5:41 am

Identifying Variable Values

Post by andy_smith »

Hi.

I'm working on a large project with multiple documents featuring a joyful plethora of conditional content, variables and all manner of delights. My colleague is away this week so there's nobody to ask.

I'm trying to identify the values attributed to a set of variables in a couple of content files. I've searched the online help and that has shown me to the Used Variables window. This seems to show me a list of variables but they don't reflect what I'm seeing in the code within the content files. I can see Document.BoardName and Document.BoardName4 - I understand that this is a project wide variables list but I'm seeing multiple instances of Document.BoardName and no instances of Document.BoardName4.

I can see the folder paths against each entry in the Variables Window but they don't seem to reflect the paths where I would expect to find the content files I'm working with. (It's difficult to identify all of the actual files I'm editing as I'm only able to open them by opening the TOC so getting to them via the Content Explorer leads me to doubt if I'm clicking on the right content files. The file names are often of little use.) Whatever the case there are many more files in the project than are shown in the Used Variables list.

Looking back at the Insert Variable dialogue it has fields called Name and Definition. I can't see a definition column in the Used Variables list. Ultimately identifying the definition of each variable is what I started out wanting to do when I started this an hour ago.

Am I not using the Used Variables list properly or am I seeing some sort of subset of all the variables in the project? I've tried opening the Used Variables list while having the focus in different files in case the list is specific to a file but I seem to get the same list. I know there are files I have open with variables in them yet those files do not appear on the Used Variables list.

Thanks for your support.

Andy
I'm on UK time (UTC+0). I work Tuesday, Wednesday and Thursday so I may not see replies outside of those days.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Identifying Variable Values

Post by NorthEast »

If you think there are variables missing from Used Variables list, then the first thing I'd check - and apologies if this is obvious - is whether you're just looking at the first page of results (it'll say page 1 of x at the top).
But if items are definitely missing from Analysis reports, then it may be a corrupt Analyzer database; although usually you get false positives, rather than missing stuff. If you close down Flare and delete the 'Analyzer' folder for that project, it'll delete the Analyzer database, and Flare will regenerate it when you next open the project.

When looking at a variable in a topic (or snippet) in Flare's editor, or in the Analysis Used Variables, it's not really possible to be sure of the variable definition. It's a variable, so it can vary depending on its context.
So to see what definition is used, you need to preview the topic for the appropriate target.

You set a default variable definition in the variable set file itself, but that definition can be overridden at the target level, topic level, and snippet level (within a topic).
* For variables used in topics, these can be overridden by setting the variable definition in the target Variables tab.
* For variables used in snippets, these can be overridden by setting the variable definition with Snippet Variables in (a) the topic properties (to set definitions for all snippets in a topic), and also (b) the snippet instance (to set definitions for individual snippets within a topic).

So when you work with variables in a topic, the definition can vary between targets. When you work with variables in snippets, that definition can vary between targets too, but can also vary for any snippet variable definitions (which have priority).
andy_smith
Propeller Head
Posts: 24
Joined: Wed Jun 16, 2021 5:41 am

Re: Identifying Variable Values

Post by andy_smith »

Some weeks after I posted this question it's become clear to me why I was confused. Yes I was only looking at the first part of the list, so no it wasn't obvious but I'm still getting used to the interface. :shock:

I was further confused when you suggested that variables can be assigned multiple values instead of a single set value. I'd not long done the beginners Flare course and the examples given in that course are cases such as setting a variable for a company address. The idea that a variable can be defined in a target, although it makes sense as an advanced feature, hadn't been mentioned to me and although it is in the course notes I don't think it was covered in the tutored part of the course itself. To cover that in the tutored part of the course would probably have been too much to take in.

I now get it that a variable can behave a like a string in a piece of code and be reassigned by other conditions, in this case by the target. I was expecting a variable to be a fixed piece of content which, I suppose, would be a snippet.
I'm on UK time (UTC+0). I work Tuesday, Wednesday and Thursday so I may not see replies outside of those days.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Identifying Variable Values

Post by NorthEast »

Yeah, I only mentioned that because it's an easy mistake! I don't think the Flare interface is very clear.

Snippets aren't necessarily fixed pieces of content, as you can use conditions with snippets.
And like variables, you can set conditions at different levels too:
* Conditions set at the target level apply to all topics (and snippets) in that target's output.
* Snippet conditions set in the topic properties apply to all snippets inserted in that topic.
* Snippet conditions set in the properties of an individual snippet apply only to that instance of the snippet, so you can insert a snippet multiple times in a topic and use different conditions on each instance.

Main difference is that a variable is a text-only string, whereas a snippet can contain any HTML that you could insert in the body of a topic, and its content can be controlled using conditions.
andy_smith
Propeller Head
Posts: 24
Joined: Wed Jun 16, 2021 5:41 am

Re: Identifying Variable Values

Post by andy_smith »

Hi Dave, thanks for your reply. I'm revisiting this issue months later as I'm now working in a wider context in the project and I've now done the intermediate course.

I'm now faced with the the issue that I'm trying to standardise a set of files that will be used in two groups of manuals (with three manuals in each group). The files I'm sharing between the two groups of manuals have allocated values to the variables differently in the two sets of targets. This means that BoardName2 in one manual group renders as BoardABC (as specified in the targets in that group) but BoardName2 in the other group renders as BoardXYZ (as specified in the targets for the second group).

My intuition is that I need to standardise the use of the variables across all the manuals so that BoardName2 is only ever used to express BoardABC and I'd set up a new variable for BoardXYZ. Then I can be sure that whenever I call up BoardName2 I will only ever get BoardABC.

It seems that the same set of variables have been used in all sorts of documents throughout the broad project with no care for consistency. Looking at the Used Variables list I'm wondering if I can use that to rename the variables that are used in some of the problematic files?

From what I've seen there are three variable sets, Company, Document and General.

All the variables that I'm trying to standardise are in the 'Document' set of variables. Opening the Document set in the VariableSet Editor there are BoardName, BoardName2, BoardName3, BoardName4, BoardName5. None of them have any values against them in the VariableSet Editor. The values are specified in the targets and in some targets the values are blank. The inconsistency comes from the differing categories of values specified in the targets in the two groups of manuals. (By that I mean that in some targets BoardName2 has been used to list BoardABC but in other targets BoardName2 has been used to specify BoardXYZ, whereas BoardName2 should have been used to specify the different versions of BoardABC so BoardABCv1, BoardABCv2, should always be in the BoardName2 slot and the differing versions of BoardXYZ should have been kept to it's own slot.) I would happily swap the values around in the two sets of targets but it seems BoardName2 BoardName3 and BoardName4 has been used in other places in the project and I could search forever to identify all the locations where these different variables are used.

So here's my solution. Using the VariableSet Editor I create new variables outside of the range of the current set of variables. I'm thinking BoardName51, BoardName52, BoardName53, BoardName54, BoardName55.

Now here's the bit I don't have confidence in. Can I use the Used Variables list to identify each instance of BoardName2 and reallocate it to BoardName52. If I use the Rename button, where it currently reads "Document.Boardname2" to read "Document.BoardName52" will that have the effect of editing every instance of code in that file from BoardName2 to BoardName52?

Then I can happily allocate a value to BoardName52 in the targets of the relevant manual.

I would have an experiment with this but the project is so shaky that I don't want to do something like this without understanding what I'm getting into.
I'm on UK time (UTC+0). I work Tuesday, Wednesday and Thursday so I may not see replies outside of those days.
Post Reply