cancel
Showing results for 
Search instead for 
Did you mean: 

Pull out one peice of text from large text string

Chan_Thomas
Level 3

Hi there, 

I have made an API call and the Access Token has been passed back to my Reponse Content Data Item like so: 
{"access_token":"000REPORTEXAMPLE00D66.fdjhfHDCEFE45wdkjdfWF55EXAMPLEkjfenf458DSSFE","instance_url":"https://rdpartners.my.salesforce.com","id":"https://login.salesforce.com/id/000REPORTEXAMPLE00D66/005Ue000003JmTpIAK","token_type":"Bearer","issued_at":"1746028452241","signature":"GdxCYdS8MFg0P1oyOOowBc3807pyN5FLF562cO+Ih/I="}

I need to pull out JUST the text following the {"access_token":"000REPORTEXAMPLE00D66.fdjhfHDCEFE45wdkjdfWF55EXAMPLEkjfenf458DSSFE"

So far, I have used a split string, using the commas to get the below collection
{"access_token":"000REPORTEXAMPLE00D66.fdjhfHDCEFE45wdkjdfWF55EXAMPLEkjfenf458DSSFE"
"instance_url":"https://rdpartners.my.salesforce.com"
"id":"https://login.salesforce.com/id/000REPORTEXAMPLE00D66/005Ue000003JmTpIAK"
"token_type":"Bearer"
"issued_at":"1746028452241"
"signature":"GdxCYdS8MFg0P1oyOOowBc3807pyN5FLF562cO+Ih/I="}

I then did Copy Rows to get the first row only {"access_token": ETC into a collection on its own, but now I am stuck.
I can't use a calc stage to get the row into a text data item so I can do another split string, and I don't know how else to do it. *

If you have an answer, it would be great if you could explain the answer to me also, cos I'm still quite new to this, so trying not to just copy and paste things 🙂 Thank you! 

1 BEST ANSWER

Helpful Answers

Chan_Thomas
Level 3

All is fixed, I learned that you can use the JSON to collection and it's much easier! 

View answer in original post

3 REPLIES 3

Chan_Thomas
Level 3

All is fixed, I learned that you can use the JSON to collection and it's much easier! 

Michael_S
Community Team
Community Team

Nice one @Chan_Thomas - and thank you for coming back to share the solution with us!

simone.tomaCNH
Level 4

Hi,

You can use the object utility - regex to extract this part of text.

Simone