What part of the certificate will change color (i.e. type, background) ? The background could be handled as an image. You would have to do a number of things like: create the various colors > save as graphics. Establish the path of each graphic background on your system, this info is necessary for merging graphics. Then add this info to the source data. Add a picture placeholder in your master Indesign document. A little work involved, but it can be done.
This would be the color of the text as well as possibly the stroke color of the text.
Possibly with GREP styles, but very limited as to what can change.
rather than explain it here (it's complicated) i've posted a link to a PDF which has an indesign file plus links. the PDF hopefully demonstrates what the OP wants to do, and the attached files within the PDF are what was used to make it. within the indesign file, have a look at the paragraph style which was made and look at the section "GREP styles".
otherwise if it is a background which has to change, then i completely agree with jeffrey_smith's suggestion.
A possibility could be to use a kind of 'joker' glyph, first you put an otherwise not used character (like #) in front of the name of the person you want to have different colors and such.
Then you create styles in Indesign with the necessary settings. After merging the text you can use the Find and Replace function to remove the unneeded characters and set the wanted style.
So for instance:
#Charlie - 'RedText Style' - Charlie
&Bravo - 'BlueText Style - Bravo
I saw the PDF which had a great example of the final product but didn't see the thing on how to do it...
It's very much the character style and such, along with a background color, though I'm thinking I could just add another field and instead of having it as a box made in InDesign I could just have a box in AI that I import along with my other files.
If you were to set it up with GREP styles, wouldn't the removing of the 'joker' glyph negate having the styles in the first place? As long as it had the 'joker' glyph it would format it correctly, but as soon as I deleted it, the style would revert, unless I'm missing something.
Is it possible to just have another field that you could do an 'if' statement somewhere? I saw something somewhere about scripting but in all honesty, that looked more complicated than I can go and still get everything out by deadline.
I must confess I have no experience using GREP styles. The reason I use a 'joker' character is to make it possible for the 'Find and replace' function to change the style.
If you type in the 'find' menu the 'joker' (like #) and leave the 'replace' field blank, it removes the 'joker'. The style stays intact, I use a Paragraph style, so the complete sentence changes.
So find all instances of '#' and change the style to 'RedText' and remove the '#'.
No scripting necessary. I don't doubt it could be done using GREP, but I find it not very user-friendly...
Here's how you can do a GREP style using the joker characters from W.Bravenboer's example [#Charlie &Bravo]
You would create a paragraph style that has a small font size and character color of none.
Then you would create various character styles, with the various colors and fonts styles that you want
Next, in the paragraph style you would create the multiple GREP styles - for finding instances of #, the grep would look like this (?<=#).+
and apply the character style you want. Continue for all the variations.
So the end style would apply varying character styles to text based on each joker character, leaving joker intact, but making it invisible.
in the PDF from my blog, there should be a little paperclip in the left hand side of the screen. i've taken a screengrab.
and there are the files required.
in short, don't need to use a hash tag or delimiter. use this grep:
this will select the start of the line and then any words starting with either a, c, e or h until the end of the line.
have a look at the attachments and see what i've done.