# Switch statement in app studio

**URL:** <https://www.epiusers.help/t/switch-statement-in-app-studio/137699>\
**Category:** Kinetic ERP\
**Tags:** customization, kinetic, application-studio\
**Created:** [September 30, 2026, 8:09pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699 "2026-09-30T20:09:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [September 30, 2026, 8:09pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/1 "2026-09-30T20:09:56Z")

</div>

Does anyone know what syntax should go in a switch statement? I am very confused, it says expression like a condition which makes sense but what would I set it equal to? I want it to be equal to whatever is under the parameter here:

 ![image](https://www.epiusers.help/uploads/default/original/3X/8/e/8e2c2dbc15ebefe49183b83b750921c430801a9b.png)

But I am not sure how to reference that here:

 ![image](https://www.epiusers.help/uploads/default/original/3X/b/7/b73e6cb068a3b33070489210bf15710c880e35b1.png)

If anyone knows let me know, I cant seem to find a forum post about it unless maybe I missed it. Thanks!

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [September 30, 2026, 8:26pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/2 "2026-09-30T20:26:44Z")

</div>

I didn’t use expression at all. But you could write a JS expression if needed. that’s what is being evaluated.

I just used the “Value” field there…

Example: I have Value set to `{TransView.MyColumn}`

Based on the resulting value… you go into Parameters and create your Case Statements

Case Statements (let’s say you create 3 or more):  
Value: A  
Value: B  
Value: C

So if the value of {TransView.MyColumn} is “A”… the event follows down that branch (action).  
I value is “B”… the event follows down that branch (action)…

etc.

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [September 30, 2026, 8:32pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/3 "2026-09-30T20:32:44Z")

</div>

Sorry… here’s some screen shots that might be helpful:

 ![image](https://www.epiusers.help/uploads/default/original/3X/c/d/cdc6d4b19b1bacfa3b00f0e6be72c9f7ac3ce3f6.png)

13 different Case Statements:

 ![image](https://www.epiusers.help/uploads/default/original/3X/f/e/fec05e43b6844f300e10b79d9397908e763c6e61.png)

Which each look like this:

 ![image](https://www.epiusers.help/uploads/default/original/3X/8/0/809319a2b4c0608dfa11044c91e62d4c115b28dd.png)

This is for our barcode scanners scanning into MES. So they just scan a value into a text field. Column Change event fires and this switch takes over.

if they scan in a barcode value of:  
STARTPROD… do this stuff start production stuff  
STARTSU… do this start setup stuff  
STARTIND… do this start indirect labor stuff

Here’s the final event:

 ![image](https://www.epiusers.help/uploads/default/original/3X/f/8/f88aef654f0d5dd9461b8272e7e0fe25c5cbd6e5.png)

---

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [September 30, 2026, 8:35pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/4 "2026-09-30T20:35:30Z")

</div>

hmm weird mine doesnt seem to be working when I do that, maybe I need to be using transview or something else besides CallContextBpmData, or is my syntax wrong somehow?

 ![image](https://www.epiusers.help/uploads/default/original/3X/2/9/29fcb975d336ddd78bdaf853c7968796d2e77c2a.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/b/4/b40f8188173b680fc9d0df8614b8d4eb81bddde6.png)

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [September 30, 2026, 8:37pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/5 "2026-09-30T20:37:33Z")

</div>

setup looks okay. Can you see anything happen in debugger?

---

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [September 30, 2026, 8:49pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/6 "2026-09-30T20:49:12Z")

</div>

![image](https://www.epiusers.help/uploads/default/original/3X/f/3/f3f851f741831fda5fab7895bcc983b516f6af7d.png)

I mean something is happening, but no mention of our character field

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [October 1, 2026, 11:52am UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/7 "2026-10-01T11:52:14Z")

</div>

yeah, mine doesn’t say anything either about the Transview field I’m referencing… so that’s probably normal.

What kind of action are you trying to do afterwards to show that it is working?

---

<div class="post-metadata">

**Author:** ![JacobF](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@JacobF](https://www.epiusers.help/u/JacobF)\
**Post date:** [October 1, 2026, 12:15pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/9 "2026-10-01T12:15:38Z")

</div>

I was able to get the CallContextBpmData.Character01 field and other fields to populate in the Console log by having the Value equal to “switch” and the expression to {TableName.FieldName}.

 ![image](https://www.epiusers.help/uploads/default/original/3X/c/a/cadaef76eb0b1c9567d937c7690f30900ac1a841.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/4/2/420e3871a89a2991fe4aef42fdf3ce10181587c2.png)

---

<div class="post-metadata">

**Author:** ![knash](https://www.epiusers.help/user_avatar/www.epiusers.help/knash/32/74179_2.png) [@knash](https://www.epiusers.help/u/knash)\
**Post date:** [October 1, 2026, 12:20pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/10 "2026-10-01T12:20:52Z")

</div>

Thought of calling a function?

---

<div class="post-metadata">

**Author:** ![Hally](https://www.epiusers.help/user_avatar/www.epiusers.help/hally/32/1263_2.png) [@Hally](https://www.epiusers.help/u/Hally)\
**Post date:** [October 1, 2026, 12:25pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/11 "2026-10-01T12:25:06Z")

</div>

That was my first thought also.

---

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [October 1, 2026, 3:10pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/12 "2026-10-01T15:10:00Z")

</div>

I just have a dialog show, here is a screenshot, and I am testing on a button click just to prove this out

 ![image](https://www.epiusers.help/uploads/default/original/3X/b/7/b7456897ffaa81570122fdd8764cb2beae426c43.png)

---

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [October 1, 2026, 3:13pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/13 "2026-10-01T15:13:18Z")

</div>

Yeah I mean at this point I guess I might as well, I can also accomplish this by using conditionals instead, I was just kinda curious about how this switch statement works exactly

---

<div class="post-metadata">

**Author:** ![knash](https://www.epiusers.help/user_avatar/www.epiusers.help/knash/32/74179_2.png) [@knash](https://www.epiusers.help/u/knash)\
**Post date:** [October 1, 2026, 4:05pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/14 "2026-10-01T16:05:08Z")

</div>

all good. just saw the tall switch stack and was like whoa

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [October 1, 2026, 4:27pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/15 "2026-10-01T16:27:07Z")

</div>

I thought dialog-show was deprecated. I always use message-handler. Not sure if that plays into this or not.

---

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [October 1, 2026, 5:39pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/16 "2026-10-01T17:39:20Z")

</div>

okay I did switch it over, but I did notice I am getting a different error code now:

 ![image](https://www.epiusers.help/uploads/default/original/3X/4/3/43432b373d3581b783ac28d688174da3c0770806.png)

---

<div class="post-metadata">

**Author:** ![GabeFranco](https://www.epiusers.help/user_avatar/www.epiusers.help/gabefranco/32/80642_2.png) [@GabeFranco](https://www.epiusers.help/u/GabeFranco)\
**Post date:** [October 1, 2026, 5:49pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/17 "2026-10-01T17:49:04Z")

</div>

It looks like the expression evaluator is trying to treat Pending as a variable and evaluate it, try surrounding with single quotes ‘Pending’

---

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [October 1, 2026, 5:55pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/18 "2026-10-01T17:55:46Z")

</div>

same thing with single quotes

 ![image](https://www.epiusers.help/uploads/default/original/3X/d/3/d3d4b397b792b9fdaf952b1174b02f01cffc6a41.png)

 ![image](https://www.epiusers.help/uploads/default/original/3X/0/b/0b153f91a7bb07bedad13163f750e40bcebf31c7.png)

---

<div class="post-metadata">

**Author:** ![GabeFranco](https://www.epiusers.help/user_avatar/www.epiusers.help/gabefranco/32/80642_2.png) [@GabeFranco](https://www.epiusers.help/u/GabeFranco)\
**Post date:** [October 1, 2026, 7:03pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/19 "2026-10-01T19:03:34Z")

</div>

hmm, that still looks like appstudio is trying to Eval it as an expression, i wonder if you check the Dev Tools Network tab for the json in “Preview” or “Response” for the GetApp call on the draft preview, if its really saving it with the single quotes, check in the json, i suspect it’s still saving as “Pending” vs. “‘Pending’”

---

<div class="post-metadata">

**Author:** ![KP\_Interface](https://www.epiusers.help/user_avatar/www.epiusers.help/kp_interface/32/62305_2.png) [@KP\_Interface](https://www.epiusers.help/u/KP_Interface)\
**Post date:** [October 5, 2026, 1:25pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/20 "2026-10-05T13:25:18Z")

</div>

Guessing this is the line you are referring to? It does look like it is set to just “Pending” instead of “‘Pending’”

 ![image](https://www.epiusers.help/uploads/default/original/3X/7/d/7d5b30b32f4547fb28cdbff5c4f32d96354106dc.png)

So I added the single quotes on the row update and I got this error:

 ![image](https://www.epiusers.help/uploads/default/original/3X/4/5/45b37d37276b488557f2c13f997ee8bbabc6384d.png)

But I guess I am going about this the wrong way? If anyone knows let me know. Thanks for the help everyone!

---

<div class="post-metadata">

**Author:** ![GabeFranco](https://www.epiusers.help/user_avatar/www.epiusers.help/gabefranco/32/80642_2.png) [@GabeFranco](https://www.epiusers.help/u/GabeFranco)\
**Post date:** [October 5, 2026, 3:18pm UTC](https://www.epiusers.help/t/switch-statement-in-app-studio/137699/21 "2026-10-05T15:18:25Z")

</div>

Try with double quotes? I’ve done it this way before but it was at a previous company so I don’t have the dashboard to look at/reference unfortunately. From memory I think it was single quotes, but it might have been on the expression and not the value.

You could try to put the (single or double) quotes around the expression in the switch too “{CallContextBpmData.Character01}”

[Next page](https://www.epiusers.help/t/switch-statement-in-app-studio/137699.md?page=2)
