@@ -79,7 +79,7 @@ var organisations = [
79
79
{ name :"University of Tasmania" , organisationId :"a5e86f4e-553a-4144-b77c-cadbe60a3a0b" }
80
80
] ;
81
81
82
- for ( var i = 40 ; i < 43 ; i ++ ) {
82
+ for ( var i = 1 ; i < csvRows . length ; i ++ ) {
83
83
print ( "PRINT " + csvRows . length )
84
84
var projectId = UUID . generate ( ) ;
85
85
var siteId = UUID . generate ( ) ;
@@ -157,6 +157,11 @@ for(var i = 40; i < 43; i++) {
157
157
var tempAssociatedOrgs = "" ;
158
158
var tempStr = "" ;
159
159
160
+ //assign organisationId for the main organisation from excel sheet first
161
+ if ( fields [ organisationId ] ) {
162
+ project . associatedOrgs . push ( { organisationId : fields [ organisationId ] } ) ;
163
+ }
164
+
160
165
//get comma separated values from associatedOrgs field in excelsheet
161
166
if ( fields [ associatedOrgs ] . indexOf ( ',' ) != - 1 ) {
162
167
tempAssociatedOrgs = fields [ associatedOrgs ] . replace ( / " " / g, '"' ) ;
@@ -171,11 +176,6 @@ for(var i = 40; i < 43; i++) {
171
176
tempAssociatedOrgsArr = tempStr . split ( ',' ) ;
172
177
}
173
178
174
- //assign organisationId for the main organisation from excel sheet
175
- if ( fields [ organisationId ] ) {
176
- project . associatedOrgs . push ( { organisationId : fields [ organisationId ] } ) ;
177
- }
178
-
179
179
for ( var k = 0 ; k < tempAssociatedOrgsArr . length ; k ++ ) {
180
180
if ( organisations . find ( obj => obj . name === tempAssociatedOrgsArr [ k ] ) ) {
181
181
var org = organisations . find ( obj => obj . name === tempAssociatedOrgsArr [ k ] ) ;
0 commit comments