Skip to main content
Known Participant
October 15, 2021
Question

CSV string

  • October 15, 2021
  • 14 replies
  • 55 views
I have a csv string which i am getting it from blueprism through integration. i need to perform some calculation based on this value, i need to iterate this string. but i am unable to iterate its taking as only one string, i want to iterate for each line in this string.

"ABC,ABC,2,06:00:00,18:00:00,0.5,3
XYZ,XYZ,3,06:00:00,18:00:00,0.5,3"
please any suggestions on this.

    14 replies

    Participating Frequently
    October 15, 2021

    You can use split() function which splits text into a list of text elements, delimited by the text specified in the separator. In your case delimiter is ",". 

    https://docs.appian.com/suite/help/21.3/fnc_text_split.html

    split("ABC,ABC,2,06:00:00,18:00:00,0.5,3
    XYZ,XYZ,3,06:00:00,18:00:00,0.5,3", ",")

    This will return individual elements from your original string that are separated by comma. You can then use a!foreach() to iterate over each element.

    Known Participant
    October 15, 2021

    i have many lines, in each line it is seperated by comma's

    stefanhelzle0001
    Brainy
    October 15, 2021

    First, use split to get the lines using "char(10)" as the delimiter. Then, in a foreach, use the comma delimiter to get the values for each line.

    New Participant
    May 20, 2026

    If you found this post to be enjoyable, please ensure that you subscribe to ensure that you do not miss any future posts Moto X3m.

    harshas2775
    Brainy
    August 27, 2026

    Reported As SPAM

    New Participant
    August 27, 2026

    Splitting the CSV string by line breaks first should make each row easier to iterate. I’ve seen similar data-handling needs in small web projects like doodle baseball.

    harshas2775
    Brainy
    August 27, 2026

    Reported as SPAM

    mikes0011
    Brainy
    August 27, 2026

    somehow they seem to be getting worse again.  though i do enjoy how one above was posted prior to the change-over and migrated, lol.

    The Expression Guru