Binding data without repeated panel component?

**I just had a chance to look at your 5-minute CRUD video, and go through the example. My question is how do I create a CRUD app as mentioned above without using the Repeated Panel component?

Can I create write-back data binding with labels and textboxes (as the results of a data query)? I know how simple it is to create one with the repeating panel component, but I was wondering if its possible and if so a simple example on how to do it.**

I created these labels/textboxes and want to bind a row of data to them.

Clone link:

I cloned your clone link and it seems to be working? I’m not sure what is wrong?

Other than the contact email puts in the email of the administrator and not what you put in the field.


(I put ‘burgeremperor@bobsburg.com’ and not the login I made which was ‘fake@fake.com’)

Ok, maybe this is what you were thinking of? I just fiddled with it a bit.

Here is a clone link of your same app with the changes.

https://anvil.works/build#clone:5U7WTMFI35NTTRER=J5BJSQSKCWWFWEQCCN4ASTHM

I received this error in your clone

anvil.tables.TableError: More than one row matched this query
Learn more about Data tables 


  <running on the server>
  called from /libanvil/anvil/_server.py, line 42
  called from ServerModule1, line 27
  called from admin_haga_system, line 149

The problem is that I want it to display the information they place.

Example:
Company Name: XYZ
Admin: Tom
Email: Tom@outlook.com
etc…

When they click save, the row should save and the information to be displayed. When they change something and press save, it should save it and when they log off and on it should be displayed in the textbox again.

Have you been through the News Aggregator tutorial, specifically the step where they talk about editing an existing article? It goes through the techniques you need: Anvil | Update existing articles

1 Like

I think if this is what you want then this design is more complicated than it needs to be. You should just put a Simple Object column in the Users table containing a dict with this labeled information:
image

…and load the information from anvil.users.get_user() to populate it when they log in.

Then if the user wants to make a change, make a server function call passing the changes to just the simple object column (dict) and have the server_module update the column from its own call to .get_user() to make sure the logged in person can only change that one column and only their own data.

1 Like

Yes, there are no data constrains on inserting unique records into your table, you would have to do that.

Or write a more elaborate multiple field search that would return just one result.

If you type in any records that match these fields it works, since it is a unique record: