Something like toKeyedObject in Server Actions

Hi, i’m a bit stuck in this, please a bit of help:

This works perfectly in the front, but how to replicate it in Server Actions?

<dmx-value id=“var_config” dmx-bind:value="sc_config.data.toKeyedObject(‘config_Name’, ‘config_Value’)>

------And to obtain the value:---------
{{var_config.value.section_cars)}}

I want to use this to restrict certains parts of a page depending of config_Value, the idea is to output a “Set Value” depending of “Database Query” using in the front the option of “Server Side Binding” in a condicion format in node page.

The condition in node page with server side binding will be:

<% if (_('var_params_config_sys==0',locals)) { %>
---content here----
<% } %>

My table is:

id | business_id(int) | config_nNme(varchar) | config_Value(varchar) | onload(enum, yes, no)
1 | 1 | section_cars| 1 | yes
2 | 1 | section_houses| 0 | yes

Thanks

Community Page
Last updated: