Use Stored Data

Hi everyone,

I’ve been trying to look around to see if anyone can explain what the option “Use stored data” is and how to use it. I’m using the base Caspar client and when I click on my imported template, under the Inspector you can find the option. From my understanding it looks like data refers to things stored in the server data folder. I’m not sure if this option is referring to something that I need to put in that folder.
If it is then how do I set things up so that my template will use the data in the folder?
If not then I would appreciate some guidance as I can’t find anything explaining how to do this.
Any help would be appreciated.

In Caspars AMCP protocoll there are a few commands to save datasets to the servers data folder. Normally these are XML data trees, just the same as you send to your templates. But it could also be anything else.

The usage scenario is for instance a rundown for a news program. Durring the creation of the rundown you could add a template showing stock values by refering a dataset that contains the data. That can be done in advancé. You only need to know the name of the dataset. Now another specially made programm could send up to the minute stock data to the named dataset for playout.

To create these datasets you can write your own program or you can use my Excel add-in presented elsewhere on this forum (use the search function).

1 Like

Actually this is quite a nice feature of the server.
Unfortunatly it is not that well implemented in the Client.

A bit hidden is that to recall a data set you need to fill in
the first field with the name of the data set.

What I understand indeed the design goal was to set data with a different program then the client.
That’s why the option to save a data set is not present in the client.
Which makes it a bit hard too play with too see if you could use it for your application.

As I mentioned you can use this to send datasets to Caspar.

And in the client: You can switch the list on the left to show you all datasets that are available. Double clicking one, while a template is selected in the playlist adds it to the template just like in your picture.

Thanks for the help!
I’ve written an XML document that I assume is what it needs as that seems to be what Caspar usually wants. I don’t know what it’s supposed to look like or what it’s expecting in that data folder.
I found an example of what is sent to the server from the client and tried putting that in the data folder with my keys and values input instead but I haven’t had any luck.
What do you mean by “DATASET”? Is that the name of the file? Here’s what my XML looks like:

<templateData>
  <componentData id="ROWAN-LOWER-THIRD">
	<data id="Level" value="2" />
  </componentData>
</templateData>

The name of the file is data.xml and the name of the template is ROWAN-LOWER-THIRD. I tried both the name of the file and the name of the componentData id in place of “DATASET”.
Do I even need to format it in XML?

Here’s my template in the client for reference. I already created a lower third that has a dynamic text field which I can manually adjust by setting the key and value. I’m just hoping this data set can be used to fill it for me.

extension off data file needs to be “.ftd” <== I think it stands for FlashTemplateData

<templateData>
   <componentData id="f0">
 	<data id="Text" value="This is a Test" />
  </componentData> 
</templateData>

try this. not sure if the quotes need to be escaped though
I normally work with JSON

The extension seems to be the missing piece for this. Once I had the right extension the Caspar client started seeing the Stored Data file. I just called it data.ftd but I can probably just call it whatever I want (I haven’t tested this yet though).
I found that the code needed to be formatted like the following:

<templateData>
   <componentData id="Level">
 	<data id="Text" value="2" />
  </componentData>
</templateData>

Where “Level” is whatever key you have in your dynamic template and “2” is the value you want that key to have. The data id should be set to “Text” if you’re trying to display text.
You can create any additional componentData and data sections that you need. Just keep them between the same templateData tag

In order to use the data in the template you want, just make sure your template is in your rundown and selected. Then scroll down on the left hand side to the Stored Data section.
Double click the data file you want to associate with the selected template and you’ll see the name of the data file appear automatically under Key f0.
Make sure you’ve checked “Use stored data” as well.

Here’s a picture of my client setup for this example:

Thanks for the help!
I hope this helps anyone with the same question in the future. Let me know if you have any questions.

EDIT: I corrected the points that didikunz pointed out below. Thanks for the pointers!

That’s wrong. Probably that happens, because you omitted the id attribute. The correct XML should look like this:

<templateData>
	<componentData id="Level">
		<data id="text" value="2" />
	</componentData>
</templateData>

And to write these .ftd files by hand does not make much sense. The whole idea is to be able to generate the data separate of the rundown for live data coming from elsewhere, like stock or weather information.

As you already know, the file extension is .ftd and yes, the falename is the name of the dataset. Normally it is good to format the data inside the dataset the same way, as the dat, that is sent to the template when you use it normally, by giving the data fields one by one in the client. Because that makes the template usable in both ways. But for special cases it’s also possible to use any other format, but then the template must be made to handle that data format.

I think I’m missing something simple, but critical here, but I can’t seem to get this to work.

I have created a file called DATA.ftd and this is the contents:

I can see the file in the Stored Data section of the CasparCG Client and have ticked the ‘Use stored data’ box along with entering DATA as the f0 value

Can anyone point me towards where I might be making the mistake?

Thanks

Mark

Sorry - this is the code in the DATA.ftd file

Code

Two questions: the template you use has a variable called “Name”, right? And the file “Data.ftd” is encoded in UTF-8, right?

How do you create the “Data.ftd” file? I usually use the data-commands for this, as they are very similar to the CG ADD, PLAY and UPDATE commands.

1 Like

Thanks for the reply…

Yes, there’s a variable called “Name” in the template. I created the template in HYPE5 and exported a folder as HTML5. This Lower Third template works well when I manually type the values of “Name” & “Company” into the f0 and f1 fields respectively.

I created the ftd file in ‘Visual Studio Code’ and encoded in UTF-8

I’m looking at the data-commands stuff, but not really understanding that. To create the file, I simply cut & pasted the text into Visual Studio Code, edited it and saved as DATA.ftd

…and just in case I’m getting it wrong at the front end, this is the set-up with HYPE5

As I have never used Hype, I don’t know. - But are you sure, that your variable is called “Name”? As the “Unique Element ID” seems to be “f0”.

I just recreated your “Data.ftd” and ways able to play a template, that had a “Name” field. You could try changing “Name” to “f0” in your datafile…

Thanks for that, really appreciate it.

On location now and will have to run this gig the old way but I’m now thinking that you’re right that the issue is somewhere in Hype where I’m creating & naming the variables.

I’ll have a more detailed play after this weekend.

Thanks again.

Did you get this sorted out? Just as was previously stated the Id of the field is f0 , so depending on how you search the html document in your JavaScript this need to match . E.g. if you use the Olle Soprani Hype template as start this uses f0 as variable name per default