i have a string which can have more than 300 records
In this case, i need to split the record and each record should be maximum 300
and then these 300 records needs to be inputted to a website
but everytime only 300 should be inputted and innext iteration again 300 and so on
How to achieve it?
which ever is your split character you can use that but the code remains same
str.Split({"YourSplitWordOrCharacter"},StringSplitOptions.None).Chunk(300)
this will give 300 each in used as input for for loop
cheers
Please share an example string to understand the record string.
I have string like - “1”,“2”,“4”,…
what would be the character here?
and getting error as
chunks is not a member of system.array
str = “1”,“2”,“3”,…
it would be like this
try this a small correction remove s in chunks
str.Trim(""""c).Split({""","""},StringSplitOptions.None).Chunk(300)
trim to remove doubles quotes at end
and split on ","
cheers
CHunk is not member of system.array
errror
May I know what version of UiPath studio you are on?
23.4+ it would wotk
if on less then need to add a counter in loop and use str.Trim(""""c).Split({""","""},StringSplitOptions.None).Skip(counter*300).Take(300)
we can use loop counter as counter here and this to be used inside the loop and the loop would end when counter > countofitems
cheers
2022.4 is ther version
i need it urgently
could you help
counter should be initialized to 1?
and assign activity
the to part = string or list?
(in_Wonum_Str.Trim(“”““c).Split({””“,”“”},StringSplitOptions.None).Skip(counter*300).Take(300)).toList
this logic gives me 0 data
You can’t trim away your double quotes and then split by them. Change this Split({””“,”“”} to Split({”,“} if you trim before you split.
Can you firs check if split is giving any data
you can do a count after split to know count of items
better show a screenshot of the data from locals panel
cheers
Please split with comma…remove two double quotes from eachside {","}
also trim can be removed
cheers



