Server Connect Loading

Hello Every one,

Is there a way to load a server connect only if all parameters are present?

For example, “home_id” parameter is coming from a input.

When the data is on the input, server connect loads automatically…but I would like to get rid of these 500 errors!

Any hint?

Thanks!

This is a workaround:

1 Like

Is it a case where your server connect is running before your input is automatically populated with a value?

I had this problem as well. I solved it with a page flow and a wait. I have my serverconnect set to not autorun. With this page flow it waits a second and then runs the server connect. This gives the inputs/selects time to populate.

1 Like

Thanks guys!! Will try to implement your suggestions!

@patrick @George @Teodor, do you think that could be a good improvement for Server Connect? Only load the SC if all parameters are present?

Best

You can have a dynamic noload property for the SC:

<dmx-serverconnect id="sc_actionid" url="api/youraction" dmx-bind:noload="!(query.param1 && query.param2) ? 'noload' : '' "></dmx-serverconnect>

The ternary expression says that if NOT both param1 AND param2 are present, then add the noload property otherwise remove it and every change of a bound parameter will trigger the SC call.

I use it all the time and it is really effective

3 Likes

@bpj Ben, what a great tip!! Thanks!!!

1 Like