Skip to content

Can you set a requestBody attribute to an integer using a postman variable? #589

Answered by thim81
jpjpjp asked this question in Q&A
Discussion options

You must be logged in to vote

hi @jpjpjp

Can you try the following?
Make the numeric variable a string {{{varName}}}. Use your variable name, surrounded by {{{ at the start and }}}at the end, with quotes around it. That will trigger Portman to convert it into a numeric variable (and not as a default string).

 overwriteRequestBody:
                - key: is_group
                  value: false
                  overwrite: true
                - key: group_id
                  value: '{{{_categoryId}}}' # _categoryId is a Postman variable set to an integer in a previous test
                  overwrite: true

This should result in numeric (non-string) variable overwrite.

If you find a clear way to describe this in the r…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@jpjpjp
Comment options

@thim81
Comment options

@jpjpjp
Comment options

Answer selected by jpjpjp
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