How to grouping excel data to send to API

Hi Team,

I want send api in excel data for 50 count ,each 50 i need set to group G1 ,G2,G3… to update in Group column

Please help me anyone for this.

Input excel:
Input.xlsx (12.8 KB)

Regards,
Raja G

Hi @Raja.G

Could you please give some more data for better understanding?
What u wanna to share in your API
We need more data for request content

Thanks
VP

1 Like

Are you looking for segmenting the data into batches?

@Vishnuraj_Pandiyarajan2 ,

I want send Account no 50 for api call account no column is there in excel i need to pass 50 record for one call and update each 50 G1, G2, G3… in Group column

Regards,
Raja G

@Raja.G

I hope this helps. Here I am using 10000 rows you can change it to 50 as needed

cheers

@ppr ,

Yes correct

ok. just follow the link and find the explanation on how to use take, skip …

Hi @ppr ,

I got this xmal in that followed link , but i couldnt find my solution.

I want to send 50 group data to api one by one i need to send

Hi

Try this

converting the total table to chunks of 50 and assigning to dictionary of type string and datatable

keys are g1,g2 and soon , later you can fetch the tables with keys

GroupTablestoDictionary.xaml (10.0 KB)

Regards

Xaml looks like:

Could it be the case that you are working with 2023.4 Studio Version / Packages? In such cases there are some issues with the activity card visualizations. So try to do some downgrade on theUiPath.System.activities package or let us know the details / versions

1 Like

Hi @LAKSHMI_NARAYANA_PEMMASAN ,

Sorry I couldnt able to open your xmal,

Please help me for this.

are you opening separately or from opened project?

try opening separately

Regards

1 Like

@Raja.G

Did you happen to check the above method?

facing any issues in it?

cheers

1 Like

@ppr

Ok i need to update my studio, i ill do

@Anil_G ,

I am trying

1 Like

Kindly note: UiPath Studio Version vs. Package Version of e.g. UiPath.System.Activities

Which versions are in use:

  • UiPath Studio?
  • UiPath.System.Activities?

@LAKSHMI_NARAYANA_PEMMASAN ,

Separately opened but issue happened

@ppr ,

image
image

you can build by your own

steps

  1. Read range from excel
  2. use for each with argument type as int32
    and give Enumerable.Range(0,Cint(Math.Ceiling(InDt.RowCount/50))).ToArray
  3. Create Dictionary variable of type String , Datatable
    4.use assign activity in for each flow to assign key and value to dictionary
InDT.AsEnumerable.Skip(currentItem*50).Take(50).CopyToDataTable
DTDic("G"+(currentItem+1).ToString)

Later you can use the dictionary variable to fetch the datatable by providing the keys

for visualization check above attached image

Hope this helps

Regards

1 Like

should / could work. open a new XAMl and just test a quick modelling as shown in the screenshot.

Just keep in mind the buildings blocks als shown to you ba other are:

  • using the ceiling method: to get the number of segments
  • Enumerable. Range for looping purpose
  • skip/take for the Segmentation process:
Convert.ToInt32(Math.Ceiling(dtData.Rows.Count / SegmentSize))
Enumerable.Range(0,NoOfSegments).ToList
dtData.AsEnumerable.Skip(segment*SegmentSize).Take(SegmentSize).toList
1 Like