@Anonymous
You can achieve this using below expression in power automate
substring(outputs('Compose'),0,lastIndexOf(outputs('Compose'),'_'))
Replace the outputs('Compose') to the action from where you are fetching the data.
For my example I have taken the sentence how_are_you and stored it in compose action.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if the information shared helps you, please consider giving a thumbs up and mark solution as resolved