From a978ff9829a5687cb0eacec6b0d19e84b73605f7 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 24 Mar 2022 21:21:45 +0000 Subject: [PATCH] --- docs/8.0/ayanova/docs/adm-import.md | 17 +++++++++++------ server/AyaNova/Controllers/ImportController.cs | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/8.0/ayanova/docs/adm-import.md b/docs/8.0/ayanova/docs/adm-import.md index 21be9b9a..b891dcab 100644 --- a/docs/8.0/ayanova/docs/adm-import.md +++ b/docs/8.0/ayanova/docs/adm-import.md @@ -2,16 +2,21 @@ ![THIS PAGE UNDER CONSTRUCTION](img/underconstruction.svg) +Notes for docs: +Import new records - if checked will import any records that are not found to match by name +Update matching records - if checked will overwrite any existing records that match by name with any values in the import file, if you do not want a particular field updated, do not include it in the import file +all dates and times assumed to be in UTC +csv and json supported +csv must have first row headers which must match expected field names in order to map +Records are matched by primary identifier, usually "Name" field and must be unique -AyaNova 8's native data interchange format is JSON as JSON supports hiearchical structured data of the type AyaNova uses for nearly all it's object types. +Field names must be the expected ones this means csv column headers as well as json property names, unrecognized fields will be thrown out and ignored -For this reason, import ONLY supports JSON format files. Importing CSV files is *not* supported. +Each type of supported importable object's allowed fields and types is documented below -A 3rd party tool can be used to convert CSV files to JSON if necessary. -https://duckduckgo.com/?t=ffab&q=csv+to+json&ia=web +CSV will be converted to JSON before importing, if there are any errors in the CSV the import will not proceed and the results of the CSV parser's errors found will be displayed on the import page +Errors from the parser are in English language only -We recommend exporting some records of the object desired to import so that you can see the exact format used and replicate it for import - diff --git a/server/AyaNova/Controllers/ImportController.cs b/server/AyaNova/Controllers/ImportController.cs index a09f6be4..a6671db2 100644 --- a/server/AyaNova/Controllers/ImportController.cs +++ b/server/AyaNova/Controllers/ImportController.cs @@ -67,6 +67,8 @@ namespace AyaNova.Api.Controllers { public AyaType AType { get; set; } public JArray Data { get; set; } + public bool DoImport {get;set;} + public bool DoUpdate {get;set;} }