Check for different types of actors/components using tag name

Hello,

I am very new to the Unreal engine and currently on version 5.3.2.

I had a logic related question. I have different type for objects in the scene (for ex. Sofa, Table, Chair). I have added the Line tracing and currently have a check for a single tag name as shown below. What I wanted was something like a switch/if-else loop.

If it is Sofa - call custom sofa event,
else if it is a Table - call custom table event,
else if it is a Chair - call custom chair event.

Is there any reference or a tutorial or a solution you can refer me to, which will help me achieve this. Or any alternative method which is better than this.

You can have a big list of if → else → else … but the best way to do it is to use an interface