Using the file.import RAD to import a delimited file into a table

I've got a request to provid NON-administrative users the ability to text import their data into tables we have created for them, within HPSM.  The problem I have is that the existing Text Import wizard allows too much flexibility.  I need to find a way to perform that type of import, but force them to always use a specific Import descriptor and not allow them to modify the existing descriptor in any way.  Only prompt should be for the name of the file to import, table to import to should be hard-coded.

Has anyone accomplished something similar to this who could give me some guidance or examples of how they did it?

  • Verified Answer

    We had the same request.  It's a pain but we did come up with a workable solution.  

    There's two main parts to it.  The first part is the backend stuff.  You create the import descriptor, pre-determining all the fields that you're going to expose, setting up all your processing, just like you would do an import yourself.  That was the simple part.

    Then, what we did is we built a set of wizards and control tables that allow specific users access to these specific pre-defined import records.

    The control table has the map between the name of the import descriptor record, a more friendly name for the end user to know it by, and an array of capability words to control access (anyone with a listed capability word can access that import).  For example -
    Table Name: device
    Import Descriptor: cg.configurationItem.textImport.type&subtype
    Description: Update Type and Subtype values for any CI record.  
    Import Type: Update Only
    Available to: {"SysAdmin", "ICMAdmin","ConfigOwner"}

    Then, we have a series of wizards that basically replicates the first several steps from the file.import RAD. 
    1. A wizard that displays the 'File Location' dialog box (basically just a small format that uses the 'File' form widget to store a variable that points to the location of the file on their machine.
    2. A wizard that displays the records from that control table that the user is authorized to use, or pops an error if they are not authorized
    3. A wizard that skips display, takes the record they selected, loads the import descriptor, and starts to prepare the preview by calling a custom Process record to trigger the RAD application to load the first 14 lines
    4. A wizard that shows the results of that RAD call, displaying the import for them to validate they've got the right one
    5. A wizard that skips display to call another custom Process that just calls to actually run their import

  • Jacob,

    Thanks, that kindof confirms what I was thinking would be necessary if you need to use RAD.  I may have come up with a separate solution, using "us.import" RAD instead.  Did still have to create an interface that allows adjustment of the field and datatype lists, but since I didn't really need all the flexibility of the methong, I think us.import works for me.  Thoguht I'd toss that in here in case others are looking for options.