We have a form that generates an XML file that is emailed to Word Processing to get merged into a Word document. The form uses a table to totalize some columns. The client now wants any cells in which the value is null to read "N/A" in the Word document. It's easy enough to make the form *display* N/A, but to put "N/A" in the fields so that the word processor doesn't have to search and replace, I'd like to change the affected fields to text fields programmatically and set them to "N/A" so thst the XML file fields would have the "N/A" value that would be picked up by the Word mailmerge.
How big is the form? How many fields? If it is not too big you could loop through each onject in the form, test its value and if it is null set it to N/A. Or you could have an initial value of NA instead of null.
It's 8 fields, well 9 if you count the total field, so I really don't even need to loop through the entire form. The fields are numneric so that if there's a number that is input, the total field will totalize properly. The problem is that the 8 fields are scattered throughout the Word document so if I could have the XML output file values for the fields be "N/A" instead of null or "00", it would save the word processors time doing search and replace.
Well, win some, lose some! 🙂 Since it's a relatively small number of fields, I think I'll just set up some additional text fields, and if the numeric fields aren't null, load the text fields with the numbers as strings since they've been totaled already. If the numeric fields are null, load the text fields with "N/A". Then I can have Word pick up the text fields instead of the numeric fields.