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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Switch" doesn't recognize one of the "Cases" and puts it in the "Defaut-Case" - Due to white space?

(0) ShareShare
ReportReport
Posted on by 38

Hi!

 

I have built a big flow with different "Switches". Now just one single switch doesn't work...

 

The whole flow works fine without errors, but what happens is that the "Switch" doesn't recognize one of the "Cases" and puts it in the "Defaut-Case" instead of intended case "Research & product development 2". This results in that no "Task" is created in any "Planner Bucket".

 

I think I found the error, but I cannot solve it... As you can see, there is a "blank space" after the Expression result "Research & product development".

I have checked the "Form" and the "Planner Bucket"- no "blank space" there. I have updated all inputs with new naming. I have created a new "Case" with the flow. Nothing works. Anyone who knows what to do about this?

 

EmmaHaraldsson_0-1670423940374.png

And with raw inputs:

EmmaHaraldsson_3-1670425205994.png

 

 

My whole flow looks like this:

EmmaHaraldsson_1-1670424063177.png

The switch is set up like this:

 

EmmaHaraldsson_2-1670424163168.png

 

Next "Switch" contains updating of "task details" depending on cases (I have not seen any errors in this yet) works fine for the other cases:

EmmaHaraldsson_4-1670425381773.png

 

 

 

Please help ASAP!

 

Best regards

Emma

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,867 Most Valuable Professional on at

    Hi @EmmaHaraldsson,

     

    I see the answer ends with \t, which is a tab character. Have you tried removing that tab with an expression in your Switch action?

     

    Try something like below: (change the question id to your question id)

    replace(outputs('Get_response_details')?['body/r45eaa07074ac43cf9efb797fd51b091d'], '\t', '')

     

     

  • EmmaHaraldsson Profile Picture
    38 on at

    Hi @Expiscornovus ! Thanks for your reply. I don't have a clue how to do as you suggested. Where do I perform such actions? I don't know anything about coding or programming, I'm just an "ordinary office-rat" that has started using Power automate to solve digitalization for some of my departments workflows... 🙄  

     

    Try something like below: (change the question id to your question id)

    replace(outputs('Get_response_details')?['body/r45eaa07074ac43cf9efb797fd51b091d'], '\t', '')

     

     

  • Expiscornovus Profile Picture
    33,867 Most Valuable Professional on at

    Hi @EmmaHaraldsson,

     

    You can add this expression via the expression editor in the Switch action. Instead of the What type of request field.

     

    Below is a small video/gif (click on it to see it in higher resolution/quality) to demonstrate what I mean

     

    replace_question_tabcharacter.gif

  • EmmaHaraldsson Profile Picture
    38 on at

    Superthanks!!!

     

    I did exactly as you showed...

    But it still doesn't work 😥

    EmmaHaraldsson_1-1670510101773.png

     

    EmmaHaraldsson_2-1670510146199.png

    Still ending up like this: 

    EmmaHaraldsson_3-1670510259989.png

     

    Any other suggestion @Expiscornovus 

     

     

  • EmmaHaraldsson Profile Picture
    38 on at

    It is only this type of "Request type" that acts like this. All the other 5 "Request types" works... all have the same "code".

    EmmaHaraldsson_4-1670511607034.png

     

    Is it something in the form?

  • Expiscornovus Profile Picture
    33,867 Most Valuable Professional on at

    Hi @EmmaHaraldsson,

     

    Yes, it is in the question of the form. You can also adjust the label in the question. That probably makes more sense.

     

    Place the cursor at the end of your option. You should see some space between the t and the cursor. That is the tab character.

     

    removetrailingtabinquestion.gif

  • EmmaHaraldsson Profile Picture
    38 on at

    @Expiscornovus  That, I have already checked, there is no "tab" there... 😞 

    EmmaHaraldsson_0-1670571738047.png

     

    EmmaHaraldsson_1-1670571848148.png

    Any other ideas?

  • Verified answer
    EmmaHaraldsson Profile Picture
    38 on at

    I finally solved this myself. Still don't know what caused the problem. 

     

    The solution was:

    1. Remove the option (that caused error) in the form. 
    2. Add a new option in the form.

    Sad that I didn't think about this in the beginning.... But now it works, and that is what counts. Thanks @Expiscornovus  for your efforts trying to help me! Really appreciated!

  • Expiscornovus Profile Picture
    33,867 Most Valuable Professional on at

    Hi @EmmaHaraldsson,

     

    About the root cause. I am pretty sure there was a tab character in your answer, it is actually shown in one of your screenshots with the Expression results (It is the ->, not very noticeable, but it is there)

     

     

    tabcharacter.png

     

    2. You can actually see that same type of characters if you Show the paragraph marks and other hidden symbols in Word and use a tab at the end of your answer

     

    tabcharacter_inword.png

  • EmmaHaraldsson Profile Picture
    38 on at

    @Expiscornovus Yes, that is definitely the root cause, this I spotted from the beginning, but where it comes from... and how to get rid of it (except for my solution), that I cannot understand.

     

    The replacement you suggested, didn't work, and there were no space in the form. 🙄

     

    I think it must be some kind of bug, as I put it exactly the same same way when I created the new option. 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 468

#2
Haque Profile Picture

Haque 370

#3
Valantis Profile Picture

Valantis 354

Last 30 days Overall leaderboard