Skip to content

How to set default value for a variable for every request and override occasionally? #236

Answered by AnWeber
ncsibra asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry it took so long to reply. I seem to have accidentally clicked away the notification.
The way via update = 'true' is not intended and surprisingly works. Here the variable is set at the global object. But @update = "false"sets it in my variable context which wins in the following runs. The correct way would be to useexports.update` but then you run into an error that you could work around.

{{@response

    if (!httpRegion.metaData.noUpdate && response.statusCode == 200) {
        $global.counter+=1
    }
}}
###
// not increment
#…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ncsibra
Comment options

@AnWeber
Comment options

@ncsibra
Comment options

@AnWeber
Comment options

Answer selected by ncsibra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants