Forum Discussion

nedbacan's avatar
nedbacan
Frequent Contributor
2 years ago

How to separate the Inner Text into individual variables

Hello.  If someone can show me how to separate the Inner Text into individual variables. Using the Spy tool, I am able to get the innerText, in this case it is a Store name, the ID and address but a...
  • rraghvani's avatar
    2 years ago

    If it's comma seperated, then you can do something like this

    function Split()
    {
        var str = "VisionOne, ID:12345678, One Main St.";
        const arr = str.split(",");
        for (var i = 0; i < arr.length; i++) {
            Log.Message(arr[i]);
        }    
    }
  • rraghvani's avatar
    2 years ago

    It will be something like,

     

    Project.Variables.MyVariable = arr[0]; // Store single value
    
    Project.Variables.Var1 = arr; // Store array object

     

    See Project And Project Suite Variables