Extract value from JSON field

Hello,

I am trying to authenticate an API call where I send a JSON POST and get a response. The response.body contains the value of “session=XXXXX”. I am looking to determine how to extract the XXXX out of the response. Then I, of course, will use that for the subsequent GET or POST to follow. Is there some simple expression to retrieve the value after a special character like the “=” in this case? Or am I totally missing that there is already a node to generate the session ID with ease?

Thank you,

I’d recommend using a function node to split the string and save the session ID into another payload field.

payload.data.sessionId = payload.data.body.split('=')[1];

Now you can use data.sessionId in any following nodes.

Thanks Brandon. I started looking at functions late last night but hadn’t figure it out yet. I just tried your recommendation and it works great extracting the session id. Thank you very much.