How would you make a tool that creates forms to collect and edit user data?

I'm looking for a way to create something that's analogous to a paper form that's got questions and space to provide an answer. It's a kind of intake form or survey tool. I've seen people who use Google Docs, but I don't know how they get data from them. I've also heard it mentioned about maybe using Google Forms, but I don't know anything about them. I know that PDFs have a way of defining edit fields that can be accessed by name, but they're all made to look like paper forms, and in this case I'd prefer a big scrolling list of questions and answers. Something like a survey.

Some questions need a short reply, like a number, date, or yes/no type of reply.

Some require one or more lines of input. I also want support for radio buttons and checkboxes, as well as comboboxes.

I want users to have the ability to create these forms with a form creation tool, save them, then send a link to one of them to someone so they can fill it out and submit the data that can then be extracted and saved to a DB. If they need to edit the data, then it can be initialized with the current data in the DB. This is for the end user, so they don't have access to the Delphi IDE.

I've thought about a lot of different approaches, but I'm wondering what others have done along this line that worked out.

This can hardly be a novel problem; aren't there some canned solutions or approaches available?

How would you approach this as a VCL app? Largely the same with a TMS WEB Core or other form of web app.

  • Create a data entry form
  • Populate form with pre-existing data or default values
  • Add editors specific to each type of data on the form, like date pickers or drop downs or whatever.
  • Have a button that is a "submit" button or something equivalent.

When the app starts, it loads up whatever data you want to have by default, either just default values or values specific to the user or to the item that is being edited. This can be data that was originally in their browser localStorage, if they're filling out a form and there may be iterruptions between sessions, for example, or if they're regularly visiting the form. Or you can fetch data from somewhere to fill in once you know who the user is. If there's a login form first, then you can do this in a more authenticated/secure manner.

Data validation can then happen, or adjustments to the controls based on the available data. If there's an address with a Country, then you can swap between Province and State if there is a Canada/US field as an example. Likewise, drop downs might be populated differently based on other fields or on what you have already collected, that sort of thing.

The available controls in TMS WEB Core by default include most of what you'd have in a VCL app. And there are ahem a few more available as well, either as FNC components from TMS or from third-party tools or nearly any vanilla JavaScript library. So you can get a UI to handle any kind of data input you like.

Once they've selected or modified or otherwise input the data you require, then another function can write that data somewhere else. This can be via a REST API or whatever you like. If the user is going to revisit the data, then there is likely to be a desire for a consistent mechanism for storing and retrieving data. This is part of the appeal of StellarDS.io - to make that aspect simple (and potentially free for some use cases).

For my projects, I tend to like to use Tabulator as a data grid, as it has lots of input choices, but the new FNC grid sure looks pretty. Haven't used it yet, but I imagine it would work pretty well particularly with StellarDS.

The form itself, what fields are on it, their data types, and so on, is something that internally can be passed around pretty easily with JSON. So you could have a UI where you select data types and give them names or whatever other attributes you need. Then creating the form is just like in the VCL - you can dynamically add any of the input types just as easily (or nearly so) as you can when designing a form with drag/drop components. You could do that too if you wanted a fancier form designer. Lots of options.

I'm part way through writing a complete report writer where there are components like an object inspector-style control that I can use to set the width/height of elements on the page, that kind of thing. So really anything is possible, just need to sort out what you want to do or what you want it to look like.

Some of my earliest blog posts were leaning towards building a tool to be a form designer, or even a web-based IDE, where you could select elements like date pickers or whatever and drop them on a page. You can see a screenshot at the end of this post:

The users won't have access to Delphi. They're not programmers. As I said, they're currently using things like Google Docs that they send people to copy and fill out, although I don't know how they're getting the data entered into those docs into their own tools. Maybe just copy-and-paste?

The solution I'm looking for is something closer to how something like SurveyMonkey and similar things are designed.

My immediate need is to be able to send an intake form to collect data from a client and then I literally have to copy-and-paste it into another platform because they only provide the ability to enter data when logged into the Admin side of their app. I've asked them to make some changes, but they don't see the problem, even though they're encouraging us to go get clilents. I guess they figure we'll just spend 30-45 minutes on the phone with each one interviewing them and transcribing their comments in real-time.

Yes, I got that the clients won't have access to Delphi. These kinds of tools all have some kind of backend. Whether you have access to that or not is part of the problem, but like with SurveyMonkey, they can make the data available.

TMS WEB Core is of course a low-level-enough tool that you can design whatever you like, which is what I was trying to outline above. A form can be used to design other forms is perhaps the nuance that I didn't clearly articulate here. So your drop down could be a list of countries or it could be a list of things like radiobutton/text field/memo field/slider/etc.

You can then take that data and create a separate form with that as the guide.

Take to the extreme, you can design a form that is a form designer. Here's a sneak peek of my current obsession. Really, you can do pretty much anything you like.

People who are not programmers are using Google Docs to feed Q&A forms that people fill out into ChatGPT without any of this.

I sent a question to a guy I know who's doing it to see what he says.

I'll post what I hear back. Maybe ChatGPT makes it a lot simpler than we might think.

Sure, ChatGPT, Grok or any of their brethren are getting better all the time at using the tools that people would normally use. Realistically, if what you need can be met by something like SurveyMonkey, then sure, go ahead and give it a shot. AIs are able to accomplish quite a lot. Grok provided the JS code for the different "gird" backgrounds in that screenshot, with like 10 minutes of effort to test it out.

The big challenge usually is getting someone, say you for example, to explain what it is you want, both in terms of output (I want a page to do this...) and input (I don't want to click on more than 20 buttons, as a developer, also writing no code, to get there). Could be an entirely different set of tools will be more applicable than anything related to TMS WEB Core.

In fact, you could probably sit down and get an AI to recreate SurveyMonkey in the language of your choice (it is seemingly best at Python, but it is pretty good at everything, to be honest). It can spit out a complete web app with a bit of patience, to do something basic like filling out forms. Beyond that you'll probably have to be a lot more specific about what it is you want, but it will happily continue providing code all day long.

I mentioned SurveyMonkey as an example. It's not a very good solution to what I'm looking for.

I'm learning about writing prompts. It's pretty cool stuff.

Maybe interfacing with ChatGPT is like accessing the Tardis for a lot of otherwise messy and complex programming tasks?

https://x.com/i/grok/share/delThMMhUmJScXEirv7yNbFfh

I like Grok better than ChatGPT personally, but there are others for free or not free. They're super-helpful at all stages of development. Sort of like having an extra team member. Used to be they were a little iffy when it came to doing basic tasks, but these days they're quite capable. You'd be missing out if you were a person who wrote code all day and didn't have one in your corner.