Skip to main content
MarioFRS
Gold ⭐️
Sep 9, 2022 9:42 AM UTC
Solved

Extract a Part of a URL with extract text processor

Hy everyone, 

I need help to extract a part from a url with the extratct text processor.

 

/organisations/60910c2f18572ebe8aa7a677/detailedLaborcosts? (Note the ID may change)

I expect this result 60910c2f18572ebe8aa7a677

 

Thanks for suggestions

SAMSAL
SAMSALAnswer
Platinum ⭐️⭐️⭐️
Sep 9, 2022 5:38 PM UTC

Hi ,

Do you usually have the ID sorrounded with the same phrases all the time? like this:

/organisations/ID/detailedLaborcosts

If that is the case you can use the following regex in the extract text processor:

/organisations/([0-9a-z]+)/detailedLaborcosts

Hope that helps.

 

 

 

 

3 replies

SAMSAL
SAMSALAnswer
Platinum ⭐️⭐️⭐️
Sep 9, 2022 5:38 PM UTC

Hi ,

Do you usually have the ID sorrounded with the same phrases all the time? like this:

/organisations/ID/detailedLaborcosts

If that is the case you can use the following regex in the extract text processor:

/organisations/([0-9a-z]+)/detailedLaborcosts

Hope that helps.

 

 

 

 

Translate
MarioFRS
MarioFRSAuthor
Gold ⭐️
Sep 12, 2022 7:42 AM UTC

Hi, thanks for your help.

Unfortunately it does not work, here is the entire URL I have also defined variables that are part of the URL. I had not considered that these must be taken into account

https://mycompany.my.app/api/public/v1/organisations/60910c2f18572ebe8aa7a677/detailedLaborcosts?month=#{today}&apiKey=myapikey
The components highlighted in red may change, the rest is constant

Translate
MarioFRS
MarioFRSAuthor
Gold ⭐️
Sep 12, 2022 9:58 AM UTC

I have found the solution, for the changing parts of the url

https://mycompany\.my\.app/api/public/v1/organisations/([0-9a-z]+)/detailedLaborcosts.*

Translate