Using numeric string in a switch function

What are you trying to achieve?

I want to use switch to assign value by numeric string staring with ‘0’ such as 01, 02, 03, 04.
if I try switch(parameter; 01; A; 02; B; 03; C; 04; D), numeric strings in it are turned to numbers.
So the expression is finally changed to switch(parameter; 1; A; 2; B; 3; C; 4; D) and so it fails.
How can I put numeric string in switch function?

Welcome to the Make community!

Could you please provide a sample scenario and example screenshots of your issue?

To allow others to assist you with your scenario, please provide the following:

Relevant Screenshots

Please share screenshots of your scenario, any error messages, relevant module fields, and relevant filter settings. It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

By providing these details, it will allow others to assist you better.

blueprint.json (4.0 KB)

I uploaded a blueprint and a screenshot,
but in fact, the example is not necessary to review it.
When I just put {{switch(3.subject; 0909; “A”)}} to a variable, it is modified to {{switch(3.subject; 909; “A”)}}
So I can’t use ‘0909’ in switch function.

Hi @S-HO, made a quick video for you:

Thank you so much for making a video for me.
But, if I can’t use a numeric string within a switch statement, isn’t that a design flaw in make.com?

As for the previous issue, I simply “worked around” by adding any character to numeric strings I want to compare with.

image

1 Like