Simple variable function

Good morning

Please help, I’m going mad!!

I have a scenario just to fire a test of the main scenario. I pass a complicated URL to the main one and in the test I simple want to set a variable each time I test to “S” or “L” and then send the correct URL

Currently I have:

image

image

I’m only ever getting SMALL_URL though

I’m sorry I know this is ridiculously simple but I’m completely stuck

Thanks
Mike

Hey @mdb213

Use {{=}} instead of = and you can use value without double quotes.

image_2024_08_22T11_46_17_626Z-1

@ManishMandot

Thank you for taking time to answer Manish

I forgot about the braces around equals so thansk for that. Logic is still not working though

image

Always returns LARGE_URL even when Filesize = S

Mike

from the screenshot looks like there is a space before the S remove it.

1 Like

@mdb213

Make sure it is capital letter ‘S’

I simulated your scenario and it’s availabe as a blueprint below. Copy and paste it into your scenario and it should work.

To install the scenario blueprint (JSON) I made follow these steps:

  1. Expand the “Scenario Blueprint” by clicking on the arrow
  2. Copy the blueprint text into your clipboard using the copy button in the top-right of the code block (you can also select the text manually)
  3. Paste the text into a new scenario.

Your new scenario will now have all the modules I used to simulate an attempt at a solution to your question. You may need to confirm the configuration or reselect connections of each imported module in the scenario.

Scenario Blueprint
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 1,
                    "module": "util:SetVariable2",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "name": "Filesize",
                        "scope": "roundtrip",
                        "value": "L"
                    },
                    "metadata": {
                        "designer": {
                            "x": 0,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Variable name",
                                "required": true
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            },
                            {
                                "name": "value",
                                "type": "any",
                                "label": "Variable value"
                            }
                        ],
                        "interface": [
                            {
                                "name": "Filesize",
                                "label": "Filesize",
                                "type": "any"
                            }
                        ]
                    }
                },
                {
                    "id": 2,
                    "module": "util:SetVariable2",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "name": "file_url",
                        "scope": "roundtrip",
                        "value": "{{if(1.Filesize = \"S\"; \"SMALL_URL\"; \"LARGE_URL\")}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 300,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Variable name",
                                "required": true
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            },
                            {
                                "name": "value",
                                "type": "any",
                                "label": "Variable value"
                            }
                        ],
                        "interface": [
                            {
                                "name": "file_url",
                                "label": "file_url",
                                "type": "any"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}
1 Like

Wow! You are right, thanks Mr. Make
That’s pretty crazy though

1 Like

Thanks for taking the time to reply Alex. Solved elsewhere but that was useful too. Appreciate it

2 Likes