Difference between revisions of "ImportManager class"
Nguyenduyan (talk | contribs) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
|Name=<nowiki>ImportManager</nowiki> | |Name=<nowiki>ImportManager</nowiki> | ||
|Description=<nowiki>Import data and users.</nowiki> | |Description=<nowiki>Import data and users.</nowiki> | ||
− | |Constructors= | + | |InheritsFrom=object|Constructors= |
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
{{CGscriptParameters_Template|Type=array|Name=<nowiki>Headers</nowiki>|Description=<nowiki>A list of string that are the header names</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>data</nowiki>|Description=<nowiki>Data to import. An array of arrays of equal length as the headers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>advancedMode</nowiki>|Description=<nowiki>Enable setting advanced settings - Requires special navigation access</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>groupResourceId</nowiki>|Description=<nowiki>Group to add users to new users to and/or sample rule. Set to 0 to not add to group</nowiki>}} | {{CGscriptParameters_Template|Type=array|Name=<nowiki>Headers</nowiki>|Description=<nowiki>A list of string that are the header names</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>data</nowiki>|Description=<nowiki>Data to import. An array of arrays of equal length as the headers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>advancedMode</nowiki>|Description=<nowiki>Enable setting advanced settings - Requires special navigation access</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>groupResourceId</nowiki>|Description=<nowiki>Group to add users to new users to and/or sample rule. Set to 0 to not add to group</nowiki>}} | ||
Line 17: | Line 17: | ||
|Description=<nowiki>Defaults for new users. If empty or not set, uses the global defaults</nowiki>}} | |Description=<nowiki>Defaults for new users. If empty or not set, uses the global defaults</nowiki>}} | ||
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetUserImportOptions</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetUserImportOptions</nowiki>|Parameters= | ||
− | {{CGscriptParameters_Template|Type=string|Name=<nowiki>userIdColumnName</nowiki>|Description=<nowiki>The header name of the userId column</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userNameMask</nowiki>|Description=<nowiki>The mask used to create new usernames - an advanced setting</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>generatePasswords</nowiki>|Description=<nowiki>Generate passwords during import</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importUserInfo</nowiki>|Description=<nowiki>Import or Update users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPhoneNumber</nowiki>|Description=<nowiki>Import or Update phonenumbers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importAddress</nowiki>|Description=<nowiki>Import or Update addresses</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPoints</nowiki>|Description=<nowiki>Import or Update points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importQualification</nowiki>|Description=<nowiki>Import or Update qualifications</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>permissions</nowiki>|Description=<nowiki>Determine which groups should have access to the new users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>mapping</nowiki>|Description=<nowiki>Mapping between header names and import names. If empty, automapping is used</nowiki>}} | + | {{CGscriptParameters_Template|Type=string|Name=<nowiki>userIdColumnName</nowiki>|Description=<nowiki>The header name of the userId column</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userNameMask</nowiki>|Description=<nowiki>The mask used to create new usernames - an advanced setting</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>generatePasswords</nowiki>|Description=<nowiki>OBSOLETE. Always false. Generate passwords during import</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importUserInfo</nowiki>|Description=<nowiki>Import or Update users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPhoneNumber</nowiki>|Description=<nowiki>Import or Update phonenumbers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importAddress</nowiki>|Description=<nowiki>Import or Update addresses</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPoints</nowiki>|Description=<nowiki>Import or Update points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importQualification</nowiki>|Description=<nowiki>Import or Update qualifications</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=array|Name=<nowiki>permissions</nowiki>|Description=<nowiki>Determine which groups should have access to the new users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>mapping</nowiki>|Description=<nowiki>Mapping between header names and import names. If empty, automapping is used</nowiki>}} |
|Description=<nowiki>OBSOLETE. Use the new overload with parentResourceId.</nowiki>}} | |Description=<nowiki>OBSOLETE. Use the new overload with parentResourceId.</nowiki>}} | ||
{{CGscriptMethods_Template|ReturnType=Dictionary|Name=<nowiki>SetUserImportOptions</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=Dictionary|Name=<nowiki>SetUserImportOptions</nowiki>|Parameters= | ||
− | {{CGscriptParameters_Template|Type=string|Name=<nowiki>userIdColumnName</nowiki>|Description=<nowiki>The header name of the userId column</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userNameMask</nowiki>|Description=<nowiki>The mask used to create new usernames - an advanced setting</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>generatePasswords</nowiki>|Description=<nowiki>Generate passwords during import</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importUserInfo</nowiki>|Description=<nowiki>Import or Update users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPhoneNumber</nowiki>|Description=<nowiki>Import or Update phonenumbers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importAddress</nowiki>|Description=<nowiki>Import or Update addresses</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPoints</nowiki>|Description=<nowiki>Import or Update points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importQualification</nowiki>|Description=<nowiki>Import or Update qualifications</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource Id of the parent of the new users. Ignored if updating users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>mapping</nowiki>|Description=<nowiki>Mapping between header names and import names. If empty, automapping is used</nowiki>}} | + | {{CGscriptParameters_Template|Type=string|Name=<nowiki>userIdColumnName</nowiki>|Description=<nowiki>The header name of the userId column</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>userNameMask</nowiki>|Description=<nowiki>The mask used to create new usernames - an advanced setting</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>generatePasswords</nowiki>|Description=<nowiki>OBSOLETE. Always false. Generate passwords during import</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importUserInfo</nowiki>|Description=<nowiki>Import or Update users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPhoneNumber</nowiki>|Description=<nowiki>Import or Update phonenumbers</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importAddress</nowiki>|Description=<nowiki>Import or Update addresses</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importPoints</nowiki>|Description=<nowiki>Import or Update points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>importQualification</nowiki>|Description=<nowiki>Import or Update qualifications</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Resource Id of the parent of the new users. Ignored if updating users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Dictionary|Name=<nowiki>mapping</nowiki>|Description=<nowiki>Mapping between header names and import names. If empty, automapping is used</nowiki>}} |
|Description=<nowiki>Set specific options for importing new users or altering existing users</nowiki>}} | |Description=<nowiki>Set specific options for importing new users or altering existing users</nowiki>}} | ||
− | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} | + | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}} |
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>Validate</nowiki>|Description=<nowiki>Same as Validate(true)</nowiki>}} | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>Validate</nowiki>|Description=<nowiki>Same as Validate(true)</nowiki>}} | ||
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>Validate</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>Validate</nowiki>|Parameters= | ||
Line 28: | Line 28: | ||
|Description=<nowiki>Validate prior to actual importing. Throws if errors, otherwise returns warning.</nowiki>}} | |Description=<nowiki>Validate prior to actual importing. Throws if errors, otherwise returns warning.</nowiki>}} | ||
|Properties= | |Properties= | ||
− | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki> | + | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Culture</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/set the culture used during import in case we don't want to use the logged-in-user's one (UseLoggedInUsersCultureDuringImport = false)</nowiki>}} |
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Language</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/set the language used when importing text</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Language</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/set the language used when importing text</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | ||
− | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}} | + | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}} |
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>UseLoggedInUsersCultureDuringImport</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/set if the culture used during import is the same as the logged in user or invariant culture. Default is invariant</nowiki>}} | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>UseLoggedInUsersCultureDuringImport</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/set if the culture used during import is the same as the logged in user or invariant culture. Default is invariant</nowiki>}} | ||
}} | }} | ||
− | |||
− | |||
=== <span style="color:#DF8621">'''Examples'''</span> === | === <span style="color:#DF8621">'''Examples'''</span> === | ||
Line 186: | Line 184: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
− | //Set culture while import. If not set will use "." format, example: "45.967" | + | //Set culture while import. If not set will use "." format, example: "45.967" |
+ | //Set Culture work combine with UseLoggedInUsersCultureDuringImport=false | ||
array Headers={"qNumber"}; | array Headers={"qNumber"}; | ||
− | array Data={{" | + | array Data={{"45,967"}}; |
Bool advancedMode=false; | Bool advancedMode=false; | ||
number groupResourceId =0; | number groupResourceId =0; |
Latest revision as of 05:47, 2 July 2020
ImportManager
Import data and users.
Parent class
Inherits from object
Constructors
- (array Headers "A list of string that are the header names", array data "Data to import. An array of arrays of equal length as the headers", bool advancedMode "Enable setting advanced settings - Requires special navigation access", int groupResourceId "Group to add users to new users to and/or sample rule. Set to 0 to not add to group") - Make a new import with the given data
Methods
- array GetPossibleAutoMasForData() - Get default automaps. First value is column name, second is actual import field
- array GetPossibleAutoMasForUser() - Get default automaps. First value is column name, second is actual import field
- Dictionary Import() - Run the Import. Note that this will commit any pending changes
- Dictionary SetDataImportOptions(int projectQuestionnaireResourceId "The resource Id of where the data should be added/updated", int type "How to treat when already have existing answer sheets. 1 for Zero or One AnswerSheet, 2 for delete existing and create new, 3 for mapping to rpqIdColumnName", string idColumnName "Mapping for column name in case type is 3 or 4", bool isCommaSeparatedFormat "Import multi questions as comma separated format", Dictionary mapping "Mapping between header names and import names. If empty, automapping is used") - Set specific options for importing data or altering existing data
- Empty SetDefaultNewUser(string languageIso "Default language", string cultureIso "Default culture", string currency "Default currency") - Defaults for new users. If empty or not set, uses the global defaults
- Empty SetUserImportOptions(string userIdColumnName "The header name of the userId column", string userNameMask "The mask used to create new usernames - an advanced setting", bool generatePasswords "OBSOLETE. Always false. Generate passwords during import", bool importUserInfo "Import or Update users", bool importPhoneNumber "Import or Update phonenumbers", bool importAddress "Import or Update addresses", bool importPoints "Import or Update points", bool importQualification "Import or Update qualifications", array permissions "Determine which groups should have access to the new users", Dictionary mapping "Mapping between header names and import names. If empty, automapping is used") - OBSOLETE. Use the new overload with parentResourceId.
- Dictionary SetUserImportOptions(string userIdColumnName "The header name of the userId column", string userNameMask "The mask used to create new usernames - an advanced setting", bool generatePasswords "OBSOLETE. Always false. Generate passwords during import", bool importUserInfo "Import or Update users", bool importPhoneNumber "Import or Update phonenumbers", bool importAddress "Import or Update addresses", bool importPoints "Import or Update points", bool importQualification "Import or Update qualifications", int parentResourceId "Resource Id of the parent of the new users. Ignored if updating users", Dictionary mapping "Mapping between header names and import names. If empty, automapping is used") - Set specific options for importing new users or altering existing users
- (From object) string ToString() - The string representation of the object.
- string Validate() - Same as Validate(true)
- string Validate(bool errorOnSemiOpenQuestion "Set to false if you need to import to questions with open parts and know that it may partially delete existing data") - Validate prior to actual importing. Throws if errors, otherwise returns warning.
Properties
- string Culture { get; set; } - Get/set the culture used during import in case we don't want to use the logged-in-user's one (UseLoggedInUsersCultureDuringImport = false)
- string Language { get; set; } - Get/set the language used when importing text
- string ObjectTypeName { get; } - The name of the type of object.
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
- bool UseLoggedInUsersCultureDuringImport { get; set; } - Get/set if the culture used during import is the same as the logged in user or invariant culture. Default is invariant
Examples
// EX for making import qnaire data without user (acreate new qas with no user)
array Headers={"Q2","Q4","Q5","TextValue","NumberValue"};
array Data={{1,"q4",1,"Text1",1}};
Bool advancedMode=false;
number groupResourceId =0;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
number qnaireRId = 15546533;
number type=1;
string rpqIdColumnName="";
bool isCommaSeparatedFormat = true;
Dictionary mapping = new Dictionary();
iM.SetDataImportOptions(qnaireRId,type,rpqIdColumnName,isCommaSeparatedFormat,mapping);
iM.Validate();
iM.Import();
//EX for import data to an existing answer sheet
array Headers={"RPQId","Q2","Q4","Q5","TextValue","NumberValue"};
array Data={{1742872963,1,"q4",1,"Text1",1}};
Bool advancedMode=false;
number groupResourceId =0;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
number qnaireRId = 15546533;
number type=3;
string rpqIdColumnName="RPQId";
bool isCommaSeparatedFormat = true;
Dictionary mapping = new Dictionary();
iM.SetDataImportOptions(qnaireRId,type,rpqIdColumnName,isCommaSeparatedFormat,mapping);
iM.Validate();
iM.Import();
//EX for import new user info and phone number
array Headers={"First name","Last name","User_Email","Language","Culture","PhoneType_NotIdentified","User_CountryCode"};
array Data={{"An","test","an@maysunshine.vn","da-DK","da-DK","12345678","dk"}};
Bool advancedMode=false;
number groupResourceId =15548117;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
string userIdColumnName="";
string userNameMask="";
bool generatePasswords=true;
bool importUserInfo = true;
bool importPhoneNumber = true;
bool importAddress=false;
bool importPoints =false;
bool importQualification=false;
number parentResourceId= 15546533;
Dictionary mapping = new Dictionary();
iM.SetUserImportOptions(userIdColumnName,userNameMask,generatePasswords,importUserInfo,importPhoneNumber,importAddress,importPoints,importQualification,parentResourceId,mapping);
iM.Validate();
iM.Import();
//EX for importing new user and new qas
array Headers={"First name","Last name","User_Email","Language","Culture","PhoneType_NotIdentified","User_CountryCode","Q2","Q4","Q5","TextValue","NumberValue"};
array Data={{"An","test2111_01","an@maysunshine.vn","da-DK","da-DK","12345678","dk",1,"q4",1,"Text1",1}};
Bool advancedMode=false;
number groupResourceId =15548117;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
string userIdColumnName="";
string userNameMask="";
bool generatePasswords=true;
bool importUserInfo = true;
bool importPhoneNumber = true;
bool importAddress=false;
bool importPoints =false;
bool importQualification=false;
number parentResourceId= 15546533;
Dictionary mapping = new Dictionary();
iM.SetUserImportOptions(userIdColumnName,userNameMask,generatePasswords,importUserInfo,importPhoneNumber,importAddress,importPoints,importQualification,parentResourceId,mapping);
number qnaireRId = 15546533;
number type=1;
string rpqIdColumnName="";
bool isCommaSeparatedFormat = true;
//Dictionary mapping = new Dictionary();
iM.SetDataImportOptions(qnaireRId,type,rpqIdColumnName,isCommaSeparatedFormat,mapping);
iM.Validate();
iM.Import();
//Using SetDefaultNewUser
array Headers={"First name","Last name","User_Email"};
array Data={{"An","test2211","an@maysunshine.vn"}};
Bool advancedMode=false;
number groupResourceId =15548117;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
string userIdColumnName="";
string userNameMask="";
bool generatePasswords=true;
bool importUserInfo = true;
bool importPhoneNumber = true;
bool importAddress=false;
bool importPoints =false;
bool importQualification=false;
number parentResourceId= 15546533;
Dictionary mapping = new Dictionary();
iM.SetUserImportOptions(userIdColumnName,userNameMask,generatePasswords,importUserInfo,importPhoneNumber,importAddress,importPoints,importQualification,parentResourceId,mapping);
string languageIso="da-DK";
string cultureIso="da-DK";
string currency="USD";
iM.SetDefaultNewUser(languageIso, cultureIso,currency );
iM.Validate();
iM.Import();
//Update an existing user
array Headers={"userId","Language","Culture","Currency"};
array Data={{"90414076","da-DK","da-DK","USD"}};
Bool advancedMode=false;
number groupResourceId =15548117;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
string userIdColumnName="userId";
string userNameMask="";
bool generatePasswords=true;
bool importUserInfo = true;
bool importPhoneNumber = true;
bool importAddress=false;
bool importPoints =false;
bool importQualification=false;
number parentResourceId= 15546533;
Dictionary mapping = new Dictionary();
iM.SetUserImportOptions(userIdColumnName,userNameMask,generatePasswords,importUserInfo,importPhoneNumber,importAddress,importPoints,importQualification,parentResourceId,mapping);
iM.Validate();
iM.Import();
//update an existing qas by CustomerId (using SetDataImportOptions with type 4)
//CustomerID must be a text field, not numeric
array Headers={"CustomerID","Q1","Age"};
array Data={{"AB123",2,1}};
Bool advancedMode=false;
number groupResourceId =0;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
number qnaireRId = 15562388;
number type=4;
string idColumnName="CustomerID";
bool isCommaSeparatedFormat = true;
Dictionary mapping = new Dictionary();
iM.SetDataImportOptions(qnaireRId,type,idColumnName,isCommaSeparatedFormat,mapping);
iM.Validate();
iM.Import();
//Set culture while import. If not set will use "." format, example: "45.967"
//Set Culture work combine with UseLoggedInUsersCultureDuringImport=false
array Headers={"qNumber"};
array Data={{"45,967"}};
Bool advancedMode=false;
number groupResourceId =0;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
number qnaireRId = 15636598;
number type=1;
string rpqIdColumnName="";
bool isCommaSeparatedFormat = true;
Dictionary mapping = new Dictionary();
//iM.UseLoggedInUsersCultureDuringImport=false;
iM.Culture = "da-DK";
iM.SetDataImportOptions(qnaireRId,type,rpqIdColumnName,isCommaSeparatedFormat,mapping);
iM.Validate();
iM.Import();
//set language while import. If don't set, will use login user language
array Headers={"RPQ_StartDato","RPQ_SlutDato","RPQ_Status", "Q1"};
array Data={{"2018-06-18 02:49:06","2018-06-18 02:51:44","Successfuldt interview", "1"}};
Bool advancedMode=true;
number groupResourceId =0;
ImportManager iM = new ImportManager (Headers, Data, advancedMode, groupResourceId);
number qnaireRId = 15636646;
number type=1;
string rpqIdColumnName="";
bool isCommaSeparatedFormat = true;
Dictionary mapping = new Dictionary();
iM.Language = "da-DK";
iM.SetDataImportOptions(qnaireRId,type,rpqIdColumnName,isCommaSeparatedFormat,mapping);
iM.Validate();
iM.Import();