I have a Power Automate use case where incoming emails are assigned a category based on the from, name of and # of attachments, and certain keywords in the email body/subject. I would like to store all the categorization logic in a single action/expression. The action would have its output a single string category value. For example, something like below (this would work in Power BI/DAX). There can be potentially hundreds of categories, each with their own unique logic . Is something like this possible? Or would I need to nest an insane amount of ifelse calls?
SWITCH(TRUE,
or(and(contains(body,'abc'),contains(subject,'def')),hasattachment=True),
"Category 1",
and(contains(body,'def'),contains(subject,'def')),
"Category 2",
"Unknown"
)