# Facing code disappearance issue from switch case

**URL:** <https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371>\
**Category:** Studio\
**Tags:** question, studio, system, activities\
**Created:** [1. März 2025 um 06:29 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371 "2025-03-01T06:29:14Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priti\_Panchal](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/priti_panchal/32/184831_2.png) [@Priti\_Panchal](https://forum.uipath.com/u/Priti_Panchal)\
**Post date:** [1. März 2025 um 06:29 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/1 "2025-03-01T06:29:14Z")

</div>

Hi everyone,

I’m encountering an issue where the code inside my Switch Case activity disappears. I develop and save the code within the Switch Case, but when I close and reopen the workflow, only the Switch Case activity remains—the code developed inside the Switch Case is gone.

Has anyone else faced this issue recently? Any guidance on how to resolve it would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [1. März 2025 um 08:12 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/2 "2025-03-01T08:12:21Z")

</div>

@Priti_Panchal

Welcome to the community

which version of studio is it?

Cheers

---

<div class="post-metadata">

**Author:** ![sharazkm32](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sharazkm32/32/492954_2.png) [@sharazkm32](https://forum.uipath.com/u/sharazkm32)\
**Post date:** [1. März 2025 um 10:36 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/3 "2025-03-01T10:36:22Z")

</div>

Are you using StudioX or Studio? Also are you using sequence Switch or Flow Switch?

---

<div class="post-metadata">

**Author:** ![arivu96](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@arivu96](https://forum.uipath.com/u/arivu96)\
**Post date:** [1. März 2025 um 10:43 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/4 "2025-03-01T10:43:33Z")

</div>

Hi @Priti_Panchal,

There are two possible reason

1. You missed to save the xaml before you close.  
2.Have you updated any packages to downgrade?

Regards,  
Arivu

---

<div class="post-metadata">

**Author:** ![ashokkarale](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashokkarale/32/474400_2.png) [@ashokkarale](https://forum.uipath.com/u/ashokkarale)\
**Post date:** [1. März 2025 um 15:03 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/5 "2025-03-01T15:03:34Z")

</div>

@Priti_Panchal,

It was a known bug in some version of UiPath.System.Activies. I don’t remember the version but try upgrading or downgrading the package version and check.

---

<div class="post-metadata">

**Author:** ![Priti\_Panchal](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/priti_panchal/32/184831_2.png) [@Priti\_Panchal](https://forum.uipath.com/u/Priti_Panchal)\
**Post date:** [3. März 2025 um 05:32 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/6 "2025-03-03T05:32:46Z")

</div>

I am using 2025.0.157 Enterprise licence version and for system activities I am using 24.10.7

---

<div class="post-metadata">

**Author:** ![Priti\_Panchal](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/priti_panchal/32/184831_2.png) [@Priti\_Panchal](https://forum.uipath.com/u/Priti_Panchal)\
**Post date:** [3. März 2025 um 05:47 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/7 "2025-03-03T05:47:17Z")

</div>

I am using Studio, and within that, I am using Sequence Switch.

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [3. März 2025 um 05:47 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/8 "2025-03-03T05:47:23Z")

</div>

@Priti_Panchal

In latest community there are reported issues like this…try to change version of system packages to 23.x and check

Cheers

---

<div class="post-metadata">

**Author:** ![icould](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/icould/32/176714_2.png) [@icould](https://forum.uipath.com/u/icould)\
**Post date:** [5. März 2025 um 11:17 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/9 "2025-03-05T11:17:15Z")

</div>

I’m experiencing the same issue—my code has disappeared.

I’m using **UiPath Studio version 2025.0.157 - Enterprise** and first noticed the problem while working with the **UiPath.System.Activities v25.2.1** package. I downgraded it to **v24.10.7** , but the issue persisted.

During my investigation, I discovered something unusual: an additional **hidden workflow** with the same name as the affected one. Please see the following snippet.

 ![A screenshot shows several file names with a highlighted text segment "6ec520a20528" and a red arrow pointing to it. (Captioned by AI)](https://global.discourse-cdn.com/uipath/original/4X/c/b/9/cb94f976a51bcd666f1ae6b78613ebcc9de5dabc.png)

This unexpected workflow appears to be the **most primitive (initial) version** of my workflow. Upon opening it, I found that it contained older activities that are now missing from my latest version.

I’m not sure where this hidden workflow is coming from or why it’s interfering with my current version.

If you’re facing the same issue, I suggest checking your system settings, making all files visible, and verifying if a similar hidden workflow exists.

Has anyone else encountered this?

---

<div class="post-metadata">

**Author:** ![Abha.Godse](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/abha.godse/32/513090_2.png) [@Abha.Godse](https://forum.uipath.com/u/Abha.Godse)\
**Post date:** [21. Mai 2025 um 15:10 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/10 "2025-05-21T15:10:49Z")

</div>

Hallo,

ich habe dasselbe Problem. Wissen wir, wie sich das Problem lösen lässt? Ich konnte auch die ursprüngliche Version nicht sehen.

Vielen Dank im Voraus für die Hilfe!

---

<div class="post-metadata">

**Author:** ![andrew.ng](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/andrew.ng/32/176627_2.png) [@andrew.ng](https://forum.uipath.com/u/andrew.ng)\
**Post date:** [18. Juni 2025 um 20:09 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/11 "2025-06-18T20:09:27Z")

</div>

Ich habe dasselbe Problem mit der Desktop-Version von Studio 2025.0.157. Ich verwende UiPath.System.Activities v25.4.4. Das Problem scheint aufzutreten, wenn ich eine Mehrfachzuweisung-Aktivität verwende. Der Workflow erkennt den Case dann nicht mehr, der Case erkennt keine Variablen im Workflow mehr, und die Gliederung erkennt die Sequenz des Case nicht. Wenn ich die XAML-Datei erneut öffne, ist der Case leer und lässt sich nicht mehr bearbeiten.

Wenn ich im Case keine Mehrfachzuweisung-Aktivität mehr verwende, tritt dieses Problem nicht auf.

---

<div class="post-metadata">

**Author:** ![vladimir.stoyanov](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vladimir.stoyanov/32/268486_2.png) [@vladimir.stoyanov](https://forum.uipath.com/u/vladimir.stoyanov)\
**Post date:** [10. Februar 2026 um 11:58 UTC](https://forum.uipath.com/t/facing-code-disappearance-issue-from-switch-case/2743371/12 "2026-02-10T11:58:41Z")

</div>

In meinem Fall trat das Problem nach dem Upgrade auf System Activities 25.10.5 auf. An die alte Version kann ich mich leider nicht erinnern …

Das passierte bei einem Switch mit einem Case ohne Aktivitäten.

**Lösung:**  
Öffne deine .xaml-Datei in einem Texteditor und suche nach:

```
<x:Null x:Key="YourCaseName" />

```

Ersetze den Eintrag damit (siehe unten auch die zusätzlichen Hinweise):

```
<Sequence x:Key="YourCaseName" DisplayName="Body" sap:VirtualizedContainerService.HintSize="450,90" sap2010:WorkflowViewState.IdRef="Sequence_2">
  <sap:WorkflowViewStateService.ViewState>
    <scg:Dictionary x:TypeArguments="x:String, x:Object">
      <x:Boolean x:Key="IsExpanded">True</x:Boolean>
    </scg:Dictionary>
  </sap:WorkflowViewStateService.ViewState>
</Sequence>

```

Achte in der ersten Zeile bei „sap2010:WorkflowViewState.IdRef=“ **Sequence\_2** ”“ darauf, dass dieselbe IdRef nicht bereits im Workflow verwendet wird, und ändere sie in eine eindeutige Nummer. Das ist allerdings nur geraten, nicht bestätigt 🙂

Alternativ kannst du den Eintrag einfach aus der .xaml-Datei löschen und den Case direkt in Studio hinzufügen. So musst du dir keine Gedanken um die IdRef machen.
