Hi @Mark Daniel,
thanks for your excelent reply which makes things a lot more clear to me. I think I'm now able to understand the idea behind the whole function.
It is just a suggestion, but in my humble opinion, an error message (at any point) might be handy for a user while trying to insert data from a second data source due to the fact that actually nothing really happends when trying to insert data from a second source. In the described situation I asked myself if I have overseen something obvious, but perhaps it's just me. 🙃
It is true that I tried to use the data merge function for something it was probably never designed for: For creating automated reports. I really love LaTeX, a tool that was definetly not designed for creating fancy brochures or reports. My actual LaTeX dataflow looks like that:
A python script collects data from several sources and evaluates a lot of data / variables from them
The script also copies a default LaTeX document to a specified folder and changes
variables like company name, dates, etc.
pathes to images (or for being more precise, no absolute file names are used, so instead of adding images from C:\myfolder\default_template\graphs, images are just lying in the "graphs" folder of the actual folder where the python script adds some graphs to)
Due to the fact that I can split a document ober several files, it might just overwrite parts of the document with other files (that might be specified for a special customer)
It adds a dynamic number of tables at some parts of the text with a pre-defined number of rows and columns (think e.g. on evaluations for departments, where a table is created for each department)
Adds some text passages for different purposes
I really like Affinity Photo and Designer, so I just wanted to give the Publisher a fair chance and look how a usecase might look there. Why? Because for being honest, it is kind of a pain to create nice-looking documents with LaTeX. (I hope I didn't offend any member of the Science / LaTeX community with my last scentence. Of course LaTeX creates really great looking documents for many use-cases in science but not for highly customable design which was, and will probably never be, its purpose what's absolutely fine. It's possible, but it's hard work and not really intended. For that purpose we luckily have tools like Affinity Publisher.)
So I wanted to get the best of both worlds and miserably failed, because scripting is, as far as I know, actually not a big part of Affinity Publisher. That doesn't mean that I don't like the product, but I'm not sure if it's functions are sufficient this single purpose. Also some variables might be inserted by the data merge function, I'm not sure if it was ever designed for that many replacements where some take whole paragraphs in length. Please correct me if I'm wrong.
If we had christmas today and if I had the chance to get a present, I would wish for a simple concept to import data into publisher. This might look like that:
Inside Publisher, I create a box with a unique name (like a textbox) and also templates for text and tables
Inside a plain textfile I'm able to specify headings, paragraphs and tables (e.g. using the typical wiki style) and speficy in which textbox those shall be placed
Being able to import the text / tables using the standard import function in Publisher
It's just a thought. Something that comes very close to that actually exists in Publisher, but as far as I know I would habe to import text for every textbox without any chance on automating this process. Please correct me here too if I'm wrong.
If something like that already exists in publisher, please let me know. Otherwise I will continue to apply fancy design elements in LaTeX documents, misusing some functions that were definetly not made for this purpose and hoping to get not stoned by the LaTeX community for writing code far away from each and every best-prace approach. 😀