Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  How to add an item with a comma in a collection?

    Posted Wed December 23, 2020 05:02 AM

    Hi

    I have a variable which is a collection (List<T>) of strings.
    For example

    defVar --name var1 --type List --innertype String --value "[APPROVED,YES,APPROVAL,I AGREE,I APPROVE]"

    But I need to add a item that contains a comma like 'YES, I AGREE'

    Any ideas how this is possible? 

    Regards,

    N



    ------------------------------
    nordine vandezande
    ------------------------------


  • 2.  RE: How to add an item with a comma in a collection?

    Posted Mon December 28, 2020 08:29 PM

    Hi,
    I'm not sure how to create one during the variable declaration, but you can use the command "Add to collection" at the beginning of your script!

    defVar --name var1 --type List --innertype String --value "[APPROVED,YES,APPROVAL,I AGREE,I APPROVE]"
    add --collection "${var1}" --value "Yes, I agree"



    ------------------------------
    Lucas Lima Oliveira
    ------------------------------



  • 3.  RE: How to add an item with a comma in a collection?

    Posted Tue December 29, 2020 01:21 AM

    Maybe if WDG have some escape characters, it can be sorted out at the beginning of variable declaration? I tried backslash and then a comma but that didn't work.



    ------------------------------
    Raghav Gupta
    IBM
    ------------------------------



  • 4.  RE: How to add an item with a comma in a collection?

    Posted Wed December 30, 2020 11:35 AM

    Hi  @nordine vandezande

    You need to place the value into a text variable before using the "add" command.



    ------------------------------
    Gabriel Sanchez-WDG
    ------------------------------