cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Switch Feature For Things Other Than Just Equal

Noting we can only nest five times is it possible to use Switch feature for matching other than "equal" i.e.

Switch - From field of Email Contains:

John Smith or James Dean or Darren Martin

But they won't exactly match the From field because the From field would be John Smith <john.smith@gmail.com>

But I don't want to include this either because I might get emails from various domains so I just want it  pick up if the From field contains John Smith then continue follow etc...however if I use Switch function it is fixed on "equal" but John Smith won't equal John Smith <john.smith@gmail.com> is there a code to counter this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Switch Feature For Things Other Than Just Equal

Hi @pladavm,

 

Yes, using compose should be able to split the From field with the name and Email field:

For example, the following code:

"@first(split(triggerbody()['From'],'<'))"

49.PNG

Under Compsoe would show the result in the following way:

50.PNG

If you would like to use equal, make sure to include the double quotes with the name, for example:

If John Smith is the name you would like to use, then under the value field, use the:

"John Smith"

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Switch Feature For Things Other Than Just Equal

Hi @pladavm,

 

Yes, using compose should be able to split the From field with the name and Email field:

For example, the following code:

"@first(split(triggerbody()['From'],'<'))"

49.PNG

Under Compsoe would show the result in the following way:

50.PNG

If you would like to use equal, make sure to include the double quotes with the name, for example:

If John Smith is the name you would like to use, then under the value field, use the:

"John Smith"

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (5,212)