franse
May 11, 2026, 12:53pm
1
Wappler 7.9.3
NodeJS
A simple question, this worked for me before:
You would need a custom formatter
dmx.Formatter('object', 'stringify', function stingfy(val) {
return JSON.stringify(val);
})
place that in a JS file and include it on your page (or put it between script tags on the page). Then use it like you would any other formatter:
somevalue.stringify()
But now it doesn't:
<!-- Wappler include head-page="layouts/main" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="customformatter" appConnect="local" components="{dmxDatastore:{},dmxFormatter:{}}" -->
<button id="btn1" class="btn" dmx-on:click="datastore1.insert({token: 1})">Button</button>
<dmx-datastore id="datastore1"></dmx-datastore>
<p>{{datastore1.data.stringify()}}</p>
<script>
dmx.Formatter('object', 'stringify', function stringify(val) {
return JSON.stringify(val);
});
</script>
<meta name="ac:route" content="/bugtest/customformatter">
Something has changed?
Thanks
PS:
Forgot to mention, dmxFormatter is included on main layout:
bpj
May 11, 2026, 1:24pm
2
Is the value definitely an object? Not a string or “"
1 Like
Ughh, need more coffee, it's an object array..
Thanks once again Ben!
It is not available in the UI but App Connect has a global json formatter that is used for debugging, you simply used it like json(datastore1.data). It does a JSON.stringify and the argument can by any type of data, does not to be explicit an object.
1 Like
Thanks Patrick, yes, saw Sid reply about that, but thought it was a general formatter problem or missing something new..
Thanks both