How do I use Smart JSON Substitution on Appsmith?

How do I use Smart JSON Substitution on Appsmith?

Few code snippets have issues while type casting:

This works:

OTABookingId: {{otaBookingId.text===""?{$exists:true}:otaBookingId.text}}

This does not:

{{otaBookingId.selectedOptionValue === undefined ? {$exists:true}:{$eq : otaBookingId.selectedOptionValue} }}

What does smart JSON substitution do?

The smart JSON substitution feature allows Appsmith to dynamically perform type conversions on field values in a request body.

This feature can be enabled, by toggling the Enable Smart Substitution option on the settings tab from the query pane.

Example:

The following topics are discussed on HowDoIDoX (#3) Series as a part of our community call: JS Promises, On page load Actions & Prepared Statements #Live - YouTube

Forkable App: Appsmith