Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..
462 views

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

Jump to solution

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?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

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

Jump to solution

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 file.import.new.preview 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 file.import.new to actually run their import

View solution in original post

2 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

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

Jump to solution

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 file.import.new.preview 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 file.import.new to actually run their import

View solution in original post

Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

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

Jump to solution

Jacob,

Thanks, that kindof confirms what I was thinking would be necessary if you need to use file.import.new 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 file.import.new methong, I think us.import works for me.  Thoguht I'd toss that in here in case others are looking for options.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.