Setting multiple variables in one "Set variable"-action

Answered

Comments

1 comment

  • Official comment
    Avatar
    Mathias Balsløw (Edited )

    Hi Philip,

    You need a 'Set Variable' action for everytime you wish to set a variable. But, you don't need so many actions. If you have numbers in your variable names, you can do it this way, or you can use a list to loop through your variables.

    You could make it like this in Foxtrot (explained with 'Foxtrot code' and an image):

    If [%variable1] = 4 then
    Loop = 9
    Set [%Variable[?Add([*CURRENT_LOOP_NUMBER],1)]] = 4
    End Loop
    End If


    Alternatively, you can use a 'VBScript' action to set as many variables as you would like within only one Foxtrot action. Like this, for example:

    RPAEngine.SetVar "Variable2", "4"
    RPAEngine.SetVar "Variable3", "4"
    RPAEngine.SetVar "Variable4", "4"
    RPAEngine.SetVar "Variable5", "4"
    RPAEngine.SetVar "Variable6", "4"
    RPAEngine.SetVar "Variable7", "4"
    RPAEngine.SetVar "Variable8", "4"
    RPAEngine.SetVar "Variable9", "4"
    RPAEngine.SetVar "Variable10", "4"

    Comment actions Permalink

Please sign in to leave a comment.