How to build a system of custom fields that the user can create, edit or delete?

Actions & Logic

Hello, everyone!

I'm building a CRM in FlutterFlow, my backend is Supabase.

The incredible differentiator of my CRM will be the integration with artificial intelligence, but that will be built and is not the topic of my talk today...

I'm trying to build a custom fields system here in FlutterFlow and I would like your help. My level of knowledge in FlutterFlow and Supabase is not very advanced, but I can say that I've already built about 40% of my app.

The custom fields system that I'm trying to build is a system where the user of my CRM can go to the settings, and then create a new custom field, where there are options such as text, number, number with decimal, switch or dropdown. It is possible to create fields for each sector within the app, such as Customers, Leads, Activities, Projects, etc...

The user can also edit the name of the field, or can delete the field.

When the user creates a new field, it appears so that they can fill it in when they add a new record in the desired sector, and it will appear in the details of the added record.

Since I'm not an expert, I watched some classes and asked ChatGPT for help. So far, I've created a table in Supabase called CustomFieldsClients, and then associated it with the Clients table, and also the CustomFieldsValue table. In this way, the Clients table stores the essential information about the client, such as name, email or phone number, the CustomFieldsClients table stores the custom fields, their types, and the options if it's a dropdown, and the CustomFieldsValue table stores the values ​​filled in these custom fields.

Finally, there is a visualization table called ClientesInfo that stores the combination of this information, presenting all the essential and additional data. I use this table to display information on the Clients page and in the more detailed client information.

My doubts start here...

1. I don't know if all of this is correct, to be honest. I don't know if I could use another way to build this system, something that is easier, and if so I would be willing to present it.

2. When the user adds a new custom field, and chooses dropdown, I used this tutorial https://www.youtube.com/watch?v=AJF7OWWEN-U to learn how to allow the user to be able to add a new option to the dropdown. I have no idea if it is working because I haven't been able to test the app yet, which brings me to the next problem.

3. I have 7 critical errors in my app that have these details: "DropDown widget with the current configuration will not function properly when generated dynamically at the moment (because it is associated with a local state variable). Consider wrapping it inside of a component and then generate the component dynamically.". Honestly, I have no idea how to fix this. I have already checked every detail of what the error points out, but everything is correct.

4. In the component I have to add a new customer, I use a listview to display all the custom fields created by the user. But how do I display exactly the type of custom field created by the user? I mean, if the custom field is a text field, or a dropdown, how do I display both? I tried adding a textfield and generating the dynamic list, that way the user can fill in the textfield and then the value is stored as the value of that custom field specifically for that customer, but what if the custom field is a dropdown?

5. In addition, I have seen several videos that teach how to use API to build this system. I honestly have no idea if it is possible, especially because I do not have a very deep knowledge of API in FlutterFlow, but if it is a simpler, more direct and error-free way, I can learn everything and thus my app will be better.

I know this is a long text, and I apologize for taking up so much of your time. But I really need your help, and this entire content can be saved here, so other people can use it in the future.

What have you tried so far?

I wrote everything I tried in the description

Did you check FlutterFlow's Documentation for this topic?
Yes
1
3 replies