In my org there is a record on a custom object which on creation populates a URL on a path field : /lightning/r/Account/0012w000019tsbCAAQ/edit
From the above mentioned URL I need the record Id to store it in a separate field. I have tried using formula field to retrieve the record Id but not sure what to do when the object name in the url is dynamic
Formula field which I created:
LEFT(RIGHT(Path__c, LEN(Path__c) - 21),18)
This removes '/lightning/r/Account/' & 'edit' but how can I make the formula dynamic depending on the type of object