i need to store the url from my website in to an URL and use part of it for an API call
...coming from the comments, I leave an answer here:
With version 6.0.0, Cypress introduced a new command: .intercept().
.intercept() allows you to manage the behavior of network requests. It supports fetch, it can intercept both request and response of your app API calls and so much more, official docs here.
Related to your case, make sure you declare your intercept command before the proper fetch action, let's say on the top of the test. Then, simply call it below in the body of the test by its alias:
cy.intercept('GET', '/project/*').as('myObject')
// ...
cy.wait('@myObject').its('response.body.data.id').then(objUUID => {
// here is your uuid
cy.log(objUUID)
})
Note, that any other action related to this uuid should be done inside above callback: .then(objUUID => {}). In case you need it shared between different tests, then intercept your request inside .beforeEach() hook and assign the uuid in a context shared variable, however, this is a bad practice (more about aliases and variables, here)