5 Replies Latest reply on Feb 21, 2017 9:53 AM by lukep25345451

    Format XML Export/Save-As

    lukep25345451

      Hello all,

      I hope to make my question as concise as possible without making my post too lengthy. Please let me know if anything is unclear.

       

      My goal from a 1000 foot view: Create a PDF checklist that managers will fill out for new hires. On this checklist they will select a check box for each system that they would like their new employee to have access to. The checklist will then be submitted to the Help Desk via email for account creation. A Help Desk technician will look over the form to ensure that all requested systems are actually appropriate for the new employee (e.g. a manager in the call center should not be checking the boxes to grant access to the various IT administration systems for their new hire, and it will be the Help Desk Technician's job to catch such a scenario). The Help Desk technician then launches a PowerShell script that will interact with the form, automating the setup of the various requested systems.

       

      How submission occurs: In my form there is a Submit button that relies on a Javascript using "this.submitform" to submit the form via email. When submitting via XML the result is beautiful when it comes to automation with PowerShell. I have a check box for each system that access is requested to, and each check box is identified by name and flagged as "Yes" if it was checked, and "Off" if it was not. Here's an example of the XML output:

       

      <AddAD>Yes</AddAD>

      <AddAccurint>Off</AddAccurint>

      <AddAdaxes>Yes</AddAdaxes>

      <AddArtiva>Yes</AddArtiva>

      <AddAzure>Off</AddAzure>

      <AddBarracuda>Off</AddBarracuda>

       

       

      The initial problem: The downside to submitting the form directly as an XML is that it's rather difficult for a Help Desk Technician to review the XML code to ensure that the form was filled out properly. Changing the form to be submitted as a PDF attachment allows the Help Desk Technician to review the form, but does not allow the information in the form to be easily passed to a PowerShell script.

       

      My proposed solution to the initial problem: Since we cannot have the user directly submit the form as an XML, then we will have them submit the form as a PDF attachment. Once the technician looks over the submitted form to ensure that everything is in order he or she will then either manually save as XML, or click a button on the form that performs this action for them (the details here I haven't worked out yet, more on that next).

       

      The problem with the proposed solution: When saving either as XML or Exporting to XML the result is an unreadable mess and does not seem to identify which check boxes have been selected on the form. I'm trying to understand why the XML is formatted differently when using "this.submitform" than any of the save commands. I have a feeling that perhaps I am only seeing the metadata in this scenario.


      Does anybody know how I can format XML via a Save-As or Export in the same fashion that "this.submitform" formats it? I am more than happy to use Javascript to accomplish this if necessary.

        • 1. Re: Format XML Export/Save-As
          try67 MVP & Adobe Community Professional

          An alternate approach would be to keep submitting the form data as XML (since that works nicely for you) but develop a simple PDF that uses the same field names where the IT technician can easily see what boxes have been ticked. They'll just need to import the XML file into the PDF (this is easily done in Acrobat) and they'll immediately have a full overview of all the permissions, and could still use the original XML file as the input for your PowerShell script. Win-Win.

          1 person found this helpful
          • 2. Re: Format XML Export/Save-As
            lukep25345451 Level 1

            I did not know that data could be imported back into the form from the XML. The downside that I should have mentioned in my original post (I hadn't gotten this far in my testing yet) is that whatever solution I end up with needs to be compatible with Reader, as I could never get the purchasing approval to get every one of my Help Desk Technicians an Acrobat license.

             

            That being said, you may have pointed me in the right direction. Once I started researching importing form data I found that Reader is compatible with FDF form data. I saved the data as FDF and opened it in a text editor and while it's not quite as pretty as XML, I'm confident that with a little effort I will be able to get PowerShell to read the FDF file and bake in the automation from there. It's not ideal, but it's much better than doing everything manually as the team does it now.

             

            Thank you, and if anybody else has any insight I'm all ears!

            • 3. Re: Format XML Export/Save-As
              Karl Heinz Kremer Adobe Community Professional

              Take a look at XFDF - as useful as FDF and as "pretty" as XML

              1 person found this helpful
              • 4. Re: Format XML Export/Save-As
                try67 MVP & Adobe Community Professional

                The other nice thing about FDF (or XFDF, as Karl mentioned) is that it's really easy to import it. You just open the PDF and then drag the (X)FDF file and drop it on top of it and it will import the data right away. This can be done in both Reader and Acrobat.

                With an XML file you need to go through the menus and select the file in a dialog window, which can be a bit annoying.

                1 person found this helpful
                • 5. Re: Format XML Export/Save-As
                  lukep25345451 Level 1

                  I decided to go with FDF because it actually works out pretty well with PowerShell. In my case, all of the pertinent information is on the 4th line. I can use PowerShell to store the 4th line as a string, then use substring separation to identify exactly the information that I'm looking for out of the string, assigning a variable to each item that contains the pertinent information. I can then use those variables to feed into PowerShell commands as I see fit.

                   

                  I almost never post on forums because I can pretty much always find what I'm looking for in previous documentation or questions asked by others. This was not one of those times, and you guys came through for me! Thanks everybody!