For the complete documentation index, see llms.txt. This page is also available as Markdown.

_import

Imports the data of an Asset.

Parameters

map

The format to determine how information will be integrated.

rows

The Asset data to be imported.

Example

FM_api('Assets_import',[
    'map' => '[{"from":"ID","to":"asset_id","filter":"","options":"","idx":0},{"from":"Asset Name","to":"asset_name","filter":"","options":"","idx":0},{"from":"Book ID","to":"book_id","filter":"","options":"","idx":0},{"from":"Serial Number","to":"code","filter":"","options":"","idx":0},{"from":"Type","to":"type","filter":"","options":"","idx":0},{"from":"Location","to":"location","filter":"","options":"","idx":0},{"from":"Location Type","to":"location_type","filter":"","options":"","idx":0},{"from":"Owner","to":"owner_id","filter":"","options":"","idx":0},{"from":"Active Status","to":"active","filter":"","options":"","idx":0},{"from":"Archived Status","to":"archived","filter":"","options":"","idx":0},{"from":"Make","to":"make","filter":"","options":"","idx":0},{"from":"Model","to":"model","filter":"","options":"","idx":0},{"from":"Value","to":"value","filter":"","options":"","idx":0}]',
    'rows' => '[["60001","test asset","12345","23465","Vehicle","","",90002,"1","0","7980","6457",""],["60002","a","a","a","Vehicle","","Area",60001,"1","0","a","a",""]]'
    ]
);

Results

On Success

{"ok":1,"errors":[],"ids":[60001,60002]}

On Failure

If the "map" parameter is not set:

If the "rows" parameter is not set:

These errors below can apply to specific Assets imported, when certain fields of their fail to be imported:

If the Book ID of an Asset is longer than 32 characters:

If the Make of an Asset is longer than 45 characters:

If the Model of an Asset is longer than 45 characters:

If the Asset Type assigned to an Asset is considered invalid:

If the Home Location Type of an Asset is invalid:

If the format of the Next Service Date for an Asset is invalid:

Last updated