The problem I am facing is that it works great only if all the data is completed, i.e. every field becomes a required field. I have tried a few ways to make this conditional, as in only if something has been completed in that field then send it, however I am not really coming right.
Is your API endpoint expecting all four fields mandatory? If that's the case, then you are limited by that, isn't it? Sorry, I might have misunderstood.
No the API endpoint could take only one of them if i like, however by doing it in this JSON style like it wants if I only enter details in one it fails.
Unlike app-connect front-end (variables, arrays & datastore/json component), there are no such components on the server-connect side, hence this challenge...
I had a tough time building dynamic json structure and eventually made it work.. Gimme some time, I will draft & share how I achieved it..
The App Connect side does not have Patch, Delete etc. which I know would be silly anyway as I imagine all APIs would require tokens for anything more than data viewing, and we do not want the keys exposed for viewing, so I have to use the server side to get the functionality.
The strange thing is that the POST to add new data works with the server connect set to POST and the form fields as input parameters like this
I tried some ways, but such a simple trivial dynamic json processing, it looks like can’t be done out of the box without custom formatter… will have to rely on @patrick for this one…
Hopefully the Data Transformation action that George promised in the other thread can deliver this.
The Data Transformation is not going to help, they are for collections (arrays). For objects we don't have any formatters and there aren't any planned at the moment. I will see if we can think of some formatters that would be helpful for manipulating objects.
In your case it is not a difficult one. Here a php function that would filter out the null values.