Skip to main content

Hello All,


I am working on SharePoint 2016 and i have a requirement to import data from a CSV file to SharePoint list using Nintex Workflow.


I am looking for nintex workflow because i want to schedule the workflow for inserting of records.


But the problem i see is that, some of the records looks to be in an unstructured format as below


 


"Name","Place","Description", "Age" -> these are the headers


"Rahul","India","He is an IT guy",23


"Indira","China","She is a gardener",56


"Frank","Russia","He is an engineer. He


has 3 kids. 


 


He is interested to travel",68


"Jersy","US","She plays with puppy",13


If we look at above contents, the 3rd item description is spread across multiple lines.


There are many records like that.


After reading from csv file, I am unable to split as proper row items due to this lengthy description with empty spaces and new lines using regular expression action in the NW.


Can anyone please help how to handle such csv file to insert data to SharePoint list using nintex workflow. The csv file has around 10000 records.


I am not using excel services because of the limitations we might have when moving to cloud.


 


Thanks in advance,


Usha.


 


 


 

@usharamanamma do you know if your description has a comma? For e.g. " He likes to play cricket, tennis, and basketball."


 


My guess is no since it will mess up the CSV file. If that's the case then can you try the below steps:


 


  1. Your headers are "Name", "Place", "Description", "Age" which means their indexing will be:
    1. Name - Index 0 - Create a variable called num_NameIndex and set default as 0

    2. Place - Index 1 - Create a variable called num_PlaceIndex and set default as 1

    3. Description - Index 2 - Create a variable called num_DescriptionIndex and set default as 2

    4. Age - Index 3 - Create a variable called num_AgeIndex and set default as 3


  2. When you read your CSV file and store it in a variable, use that in RegExp action and split it by comma, and store it in the collection i.e. collec_CSVDatas

  3. Now using the above collection, For Loop action and Index (create a variable called num_CSVIndex) in for loop, store it in slt_EachCSVData
    1. Put 4 parallel branch
      1. For the first branch, use Run If, the condition will be num_NameIndex = num_CSVIndex
        1. Set Variable action - slt_Name = slt_EachCSVData

        2. Math operation - num_NameIndex + 4 


      2. Repeat Step # 1 and sub-steps for the rest of the 3 branches




Reply