Robotic Process Automation (RPA)

 View Only
  • 1.  evaluate --expression does not work

    Posted Tue January 31, 2023 07:29 PM
    I updated the IBM RPA to 21.0.7, I tried to run below code
    evaluate --expression "98-36" startPos=value
    The value of startPos will not be 62, it still be 98-36.

    Here is part of the code I have used. ${nameLen} is 98, the result startPos is 98-36 too.

    defVar --name nameLen --type Numeric
    defVar --name nameOnlyLen --type Numeric
    setVar --name "${nameLen}" --value "${DailyReportFilename.Length}"

    setVar --name "${nameOnlyLen}" --value 36
    evaluate --expression "${nameLen}-${nameOnlyLen}" startPos=value

    The evaluate works in 21.0.4 that I had ever used.
    evaluate --expression "${filePath.Length}-${fileName.Length}" folderLength=value

    -------------
    Is this is bug?

    ------------------------------
    Yan Hai Zhao
    ------------------------------


  • 2.  RE: evaluate --expression does not work

    IBM Champion
    Posted Wed February 01, 2023 04:25 PM
    Hey Yan,

    Here is the script I tested against and this is working on version 23.0. I would recommend checking your startPos variable and confirm it is a Numeric type. If it's a text variable, it would return a string instead.

    defVar --name nameLen --type Numeric
    defVar --name nameOnlyLen --type Numeric
    defVar --name startPos --type Numeric
    setVar --name "${nameLen}" --value 96
    setVar --name "${nameOnlyLen}" --value 36
    evaluate --expression "${nameLen} - ${nameOnlyLen}" startPos=value
    logMessage --message "${startPos}" --type "Info"​


    ------------------------------
    Martin Medina
    Salient Process
    ------------------------------



  • 3.  RE: evaluate --expression does not work

    Posted Wed February 01, 2023 07:10 PM
    Martin, Thank you, It works, that's my mistake to define the varaible as String

    ------------------------------
    Yan Hai Zhao
    ------------------------------