web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / adding two values in a...
Power Automate
Unanswered

adding two values in a switch case for power automate

(0) ShareShare
ReportReport
Posted on by 4

Switch Case HELP needed,

 

Hello,

 

Is there any way to add 2 values in switch cases...I am trying to get the last to min of current time and use that to post messages in different teams channel when a new message gets posted on yammer. So, basically, I will be using the numbers to route where the messages gets posted on teams channel ( using only 5 channels). Hope you get the idea and i appreciate your feedback. Thanks 

 

 

Categories:
I have the same question (0)
  • HenWang Profile Picture
    Microsoft Employee on at

    Hi @Mer31 ,

     

    Need to understand more about the mentioned "two values" in switch control. Do you mean that you need to get the last two minutes of current time to do the switch? For example, if current time is 08:22, then you will need the number 21 and 20?

     

    Not sure I am following, please provide example of the "two" values if possible.

     

    Best Regards,

    Hen Wang

  • Mer31 Profile Picture
    4 on at

    Hi @HenWang 

     

    Thanks for the reply. I was wondering if i can use 'or' or comma to use the 2 digits (minutes) for each case. That way, I don't have to do them separately and add more cases to the switch control. 

     

    So the whole idea is to get the last min and use that to route messages on different teams channels. Hope this makes it clear. 

  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at

    I am not understanding what you want to do (either your original or revised post). However, since there would be 60 different values for minutes, you would not be able to use a switch with this value as the maximum number of cases in switch is 25.

     

    What exactly are you trying to accomplish? How do the minutes relate to five channels in Teams and posting a message?

  • Mer31 Profile Picture
    4 on at

    Hey @David_MA ,

     

    My workflow is when a new message gets posted on Yammer, post a message to different teams channel. I want to route how the messages are being posted on the channels and distribute them to avoid overload. So I am using current time of post to divert where the message gets posted on teams channel

     

    This is my fx.     last(formulaDateTime(utcNow(), 'hh:mm')) 

     

     

    0 or 9 ...channel 1

    1 or 2 ....channel 2 

    3 or 4 ....channel 5

     

    all the way to channel 5. 

     

    I am trying to use the last digit of minute (0-9) to basically route which teams channel to use. There will be a large number of posts on yammer at the same time and want to distribute the load to different channels. That is why I am using last min digit. 

     

    Hope this clarifies the confusion. thank y'all!

  • AWorley Profile Picture
    414 Super User 2024 Season 1 on at

     If the amount posted only needs to disperse across the channels' you could do a random value using the rand(min,max) expression and have it return your 1,2, and 5 channels. Then in the switch statement to place the message there. 

     

    You can also have variable pull and overwrite a MS List/Excel Cell Number and do a Do Until statement until it does not equal to MSListValue

     

    something like: 

    VarRandX = rand(1,3)

     

    Do Until: MSListValueX is not equal to VarRandX : VarRandX = rand(1,3)

     

    Switch Condition: VarRandX

    1: Post Teams Message.

    2: Post Teams Message.

    3: Post Teams Message.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard