Hotdocs Classic.
How do I import Answer Files from one library to use in another library when the answer files store similar information but the variable names between the libraries are different?
For example.
I have library I created called "Lib1".
I then created a completely different library "Lib2".
Lib1 and Lib2 do completely different things. But they do share a similar few things like:
owner names
owner addresses
The problem is that Lib1 and Lib2 map these variables differently. For example,
Lib1 would have owner name as: ownerName
Lib2 would have owner name as: ownFirstName
What can I create / do so that the user doesn't have to retype the data they use in Lib1 into Lib2 for things like Owner Names and Address.
Thank you
There is no native way to do this without renaming variables or scripting computations.
At Caret Professional Services we sometimes get requests to build Converter Computation's that permit for answer data to be transferred from one template to another. However this is only necessary when the variable naming conventions differ. This is the same in Classic and in Advance HotDocs. When programming such a computation it is advisable to use DEFAULT instructions instead of SET instructions as in most versions of HotDocs a SET instruction will lock the field and prevent the user from editing.
Side note: When the variable naming conventions are consistent the Overlay Feature (in both Classic and Advance) is really great at importing answers into a brand new interview.
If the variable names are different, they simply will not Map over. Honestly, this is the same for any programming language.
You will either need to change the variable names so that they match, or manually map them over.
To manually map the variable names you can create a computation variable and run it through your interview. It would just have a bunch of IF/THEN statements for each variable that needs to get mapped over. For example,
IF ANSWERED($Var1) DEFAULT $Var2 TO $Var1 END IF
This of course means you will need to duplicate the number of variables you have in your component studio, which may lead to even more confusion down the road.
My advice is to just refactor your code now. You need to use consistent naming conventions across your templates for this reason. Again, this isn't something that is unique or a bug within HotDocs. This applies across pretty much all programming languages where you intend to use global variables.