Switch Case/Else-If Function in Server Connect

I’m now also in need of using Switch Case instead of a heavily nested IF statement in a flow… will try and use a custom JS script for now

1 Like

I also need it a lot

1 Like

I was able to get it working nicely today writing a custom script and using dmx.app.set to get the data available in Wappler. It was a good learning experience and got the result I needed. Would be easier if it was native in Wappler, but I got it done at least.

3 Likes

That’s the best thing about Wappler and why I don’t get frustrated by roadmap and timelines. You can always find a way to build it as there are very few limitations. Although I am yet to find one.

Congrats on getting your hands messy!

2 Likes

Indeed. I think this is my 4th or 5th custom script for this project. Soon it will be on to integrating TensoflowJS.

2 Likes

While they’re requests for different features, the request for Elseif usage is nevertheless closely related to the current request and I think the votes should be considered together. Hopefully they can be implemented together - for both Server Connect and for App Connect flows.

I think the lack of these options will become increasingly problematic and limiting as Wappler becomes more powerful and people want to develop more elaborate solutions with it.

1 Like

Agreed. I think they should be merged and title should be changed. Both requests are solutions to the same problem.

If implemented, both features should probably be built at the same time so that branching statements logic is fully covered and integrated well in SC.

1 Like

There is a “switch case” usage feature request that was previously opened. but I guess it is not important enough. However, while server-side operations in the wappler interface, if conditions can sometimes be complicated. I suggested switch case to remove this complexity in using the interface, but if this is not possible, the use of “elseif” would be appropriate.

Of course, this is a decision you will make, but this is not a new feature but an improvement of an existing feature. Using nested "if condition " with the GUI is not really easy. in some cases it causes confusion. The best solution is to use “switch case” , but if it is not possible to add it, it will be better for us to use “elseif” as desired.

I have been using a nested ternary operator to do this.
"arrTotalQty.items.sum() > 499 ? 30 : arrTotalQty.items.sum() > 299 ? 25 : arrTotalQty.items.sum() > 19 ? 15 : 10"

hi @ben
feature request for server-side usage.

Thanks Serhat.

1 Like

Voted this also as a complementary feature for the condition action.
Switch Case action would also be very nice.

4 Likes

The two feature requests have been merged :slight_smile:

4 Likes

I have not been able to attend for a long time due to too much workload. but it will be really comfortable to have this feature. Thank you guys

1 Like

Please add the use of switch case or else if into SC and AC. There is a real need, especially in complex projects.

4 Likes

Bump.

2 Likes

Over 2 years on this one, is this ever going to happen or shall we just accept it is not and sulk

4 Likes

I know how you feel. One of mine Client-side image resizing was requested Oct 2018 and still no sign :frowning_face: despite having 45 votes.

Bump.

Bump.