Forum Discussion

LRuoc's avatar
LRuoc
Contributor
3 years ago

Replacing a Project Variable with new value.

Hello and many thanks for your time in reading this.   I have the following piece of code that takes a project variable with the value "Your Incident number is AA99999999" and takes a sub string of...
  • LRuoc's avatar
    3 years ago

    Resolved it

     

    function GetStringValue()
    {
    //let Str = "Your incident number is INC8393727"; //pvINCNumber
    let Str = (Project.Variables.pvINCNumber);
    Log.Message("The 'String.substr' INC number is:")
    Log.Message(Str.substr(-10, 10)); // last 10 digits

    Project.Variables.pvINCNumber = Str.substr(-10, 10);
    Log.Message("Variable is ", Project.Variables.pvINCNumber);

    }