Execute command with entity data and custom data combined

I want to execute a command with SelectedItem.component."minecraft:custom_name" and also my own data hand:offhand. Is there a way to do this just using the with subcommand?

Continue to help post