Vault Secret Variable Issue

When I tried to use the vault there is some error showing now. In last version of robocorp lab there was no error. After updating this happened.

In Robot Framework syntax *** Variables *** -section cannot contain keywords (e.g. Get Secret) and the assigned values can’t be created dynamically.

The quick fix is to embed the code from Variables -section to a keyword e.g.

*** Settings ***
Library  RPA.Robocloud.Secrets

*** Keywords ***
Get Slack Webhook
    ${slack_secret}=  Get Secret  Slack
    [Return]  ${slack_secret}[WEBHOOK]

More info about the variables section can be found in Robot Framework User Guide.

Here is another example - adapted to your use-case

*** Settings ***
Library  RPA.Robocloud.Secrets

*** Keywords ***
Setup Mail Credentials
    ${SECRET}=  Get Secret  Slack
    Set Global Variable  ${GMAIL_ACCOUNT}  ${SECRET}[username]
    Set Global Variable  ${GAMIL_PASSWORD}  ${SECRET}[password]

*** Tasks ***
My Task
  Register Protected Keywords  Setup Mail Credentials
  Setup Mail Credentials
  Log  ${GMAIL_ACCOUNT}

thank you so much for the help.