Confused about Capacitor for iOS mobile use

It is possible, but I wouldn’t go down that route, not required.

As @jmartland22 said: build an administation tool (could be done in Wappler and packaged with Electron, if it really needs to be a local application) that allows to to create/design the forms. The app then checks on launch for new form definitions (e.g. a JSON), stores the definitions on the device, renders the form on runtime (not designed as static screen in the app), and uses a local document storage to make things easier and job done. Everytime the app launches, it checks if it’s online and syncs data back to the server.

One of my current projects in flight, a contract management and signing system, works like this.

That’s how many of the “app generators” like “GoCanvas” work, they are just form generators and data collectors.

/heiko

Thank you all for your responses.

But it seems that you are now speaking of solutions outside of the native protocols of iOS apps such as would be built using xCode & Swift UI, for instance.

And, let’s say in this Admin tool, locally installed on a desktop, forms that are changed in number of fields or in the host database table input types would need revised input queries both in the call of the changed app to the hosted database to its appropriate table & that the table itself would need to be changed to match
new fields in name & type.

The Admin tool itself, after the existing form is saved in its new configuration, would have to dynamically modify its first query with a “Create table named ‘revised_xxx’ with these field names & input types” command. And dynamically generate the new call to the remote database for the revised form.

So, I can see how programmatically in the admin tool that can be done. But this is what we are talking about, correct? And that this solution is not possible for a company without software techs if the initial app was built in the iOS SDK xCode with Swift UI approach.

They way I would do it. Not sure if this would work for you and I’m sure there may be better ways.

Have tables in the ‘admin’ side:
TblForms - it would have in it fields like form name, active, company etc…
TblFormQuestions - it would have fields like fkForm, question, type (ie. Text, select, etc…), order, active, etc…
TblAnswers- fkFormQuestion, answer, userid etc…

Then on the mobile app you grab all the forms and questions that are for the users company to the local device. The actual form on the device is just a query for questions that relates to the form. It knows how to display it be the question by the type in the questions tbl.

Save the answers to the device. Then sync it all back to the admin.

2 Likes

Nope. That’s just a implementation detail and has nothing to do with Swift or Kotlin.

Not at all. Think different.

There are a multitude ways of doing it. The simplest, and most popular, is serializing the form data into a JSON object and simply store the JSON in a table field “Form Data” (or put it into the device local storage). NoSQL Databases work this way, and Wordpress, Drupal and the like are doing it this way to store custom post types or articles in MySQL without a table structure required.

A form is just a document at end.

Check out JSONForms, that’s a good example and implementation for this.

Yes, I understand the JSON approach, saving form data in a database table as one long text string the way applications like WordPress have done for decades.

It looks scary to a client who is used to reading values in “excel-like” columns the way they are used to dealing with data in typical office environments.

Has to be read, parsed out to a visual representation after being saved to the online host database. Extra steps to make it client pretty. Also on the user-in-the-field iPad device – because the goal is to make saved form data reviewable, for error checking and/or additional notes added or changed before the Online Database Synch call.

So, more coding required. Thank you all for your help!

I have just forked the JSONForms GitHub.
Thank you for the reference!

You can easily create a dynamic table based on a JSON structure.
It’s all doable and has be done in the past many times.