openblocks-dev / openblocks

🔥 🔥 🔥 The Open Source Retool Alternative
https://cloud.openblocks.dev
GNU Affero General Public License v3.0
5.83k stars 351 forks source link

Feature request: add the output of a Javascript query as an option for the body of REST query #121

Closed swright-eti closed 1 year ago

swright-eti commented 1 year ago

Use case: I want to do a PUT operation on a REST API using data from a form and I only want to submit what has changed from the original record.

There is a table of records. Clicking on a row, opens a form. The user changes a value in the form and clicks submit.

There is a script that figures out which fields in the form are different than the fields in the tables, and it returns a JSON object containing only those fields and values.

How do I get that JSON object into the body of a REST API query?

lmx1117 commented 1 year ago

image Are you doing this and what went wrong?🤔

swright-eti commented 1 year ago

I can do that. But that will send every field regardless of whether it changed or not. I want to be able to write a script to build the JSON object that will be sent to the API.

neon-balcony commented 1 year ago

Hi @swright-eti ,

It sounds like a transformer can help you with that:

image image