Text formatting is performed with Markdown, so it must be applied after any data that's being loaded has been injected into the question's text. I've used constructs like
This appointment is: **#form/days_late** days late
and they've worked correctly.
That would mean that what gets "formatted" is the text of the question after everything is loaded, so it shouldn't matter whether
days_late = '**3**'
and you output #case/days_late Days Late
or
days_late = '3'
and you output **#case/days_late** Days Late
since what ultimately gets formatted is the result:
**3** Days Late
Keep in mind that everywhere you output that label will include the markdown, so you might want to save two copies of the text (one formatted one not) depending on where it will be used.
Edit:
I just tried this and noticed that the form won't necessarily apply markdown by default unless it detects that you are trying to use it.
If you don't see Turn Off Text Formatting next to the question where you are displaying the value you can trigger markdown on a question by putting in something like
**test**
into the question text and then removing it, after which it should stay on until/unless disabled manually.
So the key thing with model iteration is that the model to iterate over has to be set when the form is opened. You cannot use any questions internal to the form in an iteration expression. You could still probably iterate over a space-separated list loaded from a case property.
Either way, it might make more sense to just use a regular repeat group without model iteration. You can make the repeat count equal to the number of words in your space-separated list and then load the n-th word into each repeat.
Best Answer
A repeat group is capable of iterating over a space separated list with a Model Iteration query, but like any repeat group auto-expansion, this can only occur over a set of values which is fixed when the form opens.
That means the list can't be determined by user input in the form, unless you follow the pattern where the repeat contains an entry for every possible selection, and uses Display Conditions around an inner group to hide elements which aren't chosen.
With those caveats: You can actually accomplish this quite simply, by providing the path to the space separated list as the Model Iteration query itself. Model iterations actually internally operate over a space separated list that they generate by performing a
join(' ', instance('something')/your/iteration/query)
operation on your input. As such, if you provide a query with only one element, the join will just return your space separated list and proceed as usual!
EDIT: Forgot to mention - if you are going to use this method and reference a question inside the form (rather tthan an instance as in my example) it needs to: