Is it possible to update/set label on field via javascritpt in Maestro?
You can apply dynamic content in your field labels using the Insert Field Value button in the label editor:
You can insert values from fields that the user has entered or values from hidden Data Fields that you update via script:
is it possible to make this behavior conditional?
I would like to achieve the following:
if isBlank(data.name) return "Applicant 1"
else return "data.name"
Yes it is. You can do this by adding a data field that has your conditional logic in the calculation rule. Then include the data field in the label instead of the actual name field.
I was being a bit ambitious and trying to put all of that behavior in the one field.
Breaking it in to the two pieces as you suggest makes it a bit more manageable.
I'll give that a try.
I've set this up, but the label is blank. Am I missing a trigger?
I used the conditional script as shown above, but it does not seem to return anything?
Just wondering how to debug this?
Hey Mark, can you confirm that your data field is visible? It may seem like a strange question because data fields don't take up any space on the page. The issue is that calculation rules do not run if the field is not visible by rule, so if the data field is contained in a block that has a visibility rule on it and the block is not visible for example, then the calculation rule will not run.
In terms of debugging, you should find this article useful:
I assume it's visible as I can't find anything that suggest it's not.
On the Properties tab there is no option to add any more rules; only Calculation is present.
The data field is within a Section > Block that are all visible.
There is nothing displayed on the Styles tab, and the Data tab has the Hidden data panel. I tried to set the Clear hidden data to Never, but that didn't have any impact.
So, I'm running out of ideas.
return "Applicant 1";
I have this working for a TextDispaly, but can't seem to get it working for a PageGroup, as part of the navigation.
I'm trying to get the following to display in the navigation chevron:
if isBlank(name) display "Your Details"
else display (name)' s Details, e.g. Mark's Details
is that possible?
I have a data field with a calculation rule to manipulate the name; that is working correctly because I can observe the behaviour in the textDisplay, but in the NavigationChevron I only get 'blank'.
I'll take a look and get back to you.
Looks like you've discovered a bug Mark - I've raised this with the Maestro team (internal ref TPD-4691).
In the meantime you can add a page group with 1 page in it and give the page group a dynamic label to match the page title.
OK, I'll experiment a bit and see what I can achieve. I'll keep an eye out for the bug fix.
FYI this was fixed in 5.1.0