Skip to content

runThen(SetVariable, myObject) - what is the right object format? #23

Closed Answered by ddwightx
migueldilaj asked this question in Q&A
Discussion options

You must be logged in to vote

Two more options:

  1. Given sourceMessageValue is not needed (because useMessageValue is false) in your use case, you can specify null or exclude the property entirely rather than using empty string. Given the other defaults as well, the below should be all you need.
const mySetVariable = {
text: myGlobalTokenResponseBody,
useMessageValue: false,
sourceMessageValueType: 'JSON',
sourceMessageValuePath: 'access_token',
targetSource: 'Global',
variableName: 'NewToken2'
};
Reshaper.event.runThen('SetVariable', mySetVariable);

FYI, in case this is useful later, the same fields in the UI that support variable tags also support them when using Reshaper.event.runThen. So if you set the myGlobalTok…

Replies: 3 comments 1 reply

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
1 reply
@migueldilaj
Comment options

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