What is the best way to bind two fields to the same data?
Is it just a case is giving both fields the same Field Reference ID?
I literally want to point my second field at the first field's data element, so that when one is updated the other is updated.
The challenge is that the first field is contained in a block which is included in the submission data (for unrelated reasons) - does this pose an issue? Or is the submission data then duplicated without any concern?
Add a calc rule to the second field, and in the script double click the first field to insert it's data reference. That will bind it in one direction.
Then add a change rule, double click the first field and add " = value", so the rule looks like:
data.firstField = value
That will give you two way binding.
By default they'll both be in the XML, so if they have different paths you'll get the same value in two places. You can untick "Include in XML" on either to remove this redundant data.
This is a really good solution, thank you. Now is it possible to do something like this to a block? (for all children with the same name)
This method doesn't work for me because I want to point to a field that is only available after submission.
I'm trying to populate the submission date and time in our receipt block. So I need to point to the xpath in the submission xml.
Or to put this another way. Maestro does not support double binding. In order to achieve this effect, you need to use rules to keep the two values in synch. I'm not sure why you need to use a calc on one field and a change rule on the other, but I suspect it may be to avoid an infinite loop.
This is great comment, but not an answer so I had to down vote it, sorry Howard :)
I just set up a component in a Maestro form that populates a receipt field by copying the path of another field into the absolute binding field? It seems to work - I didn't get any errors.
I will change it to the above method now, but thought I'd let you know.