"Admin" Form updates a User Form's Components

Hi Anvil Peeps,

I’m using a set up similar to @meredydd’ s multi page application. I have a mainForm, a UserDashboard, and an Admin form.

I’m going to control access to the Admin form via user roles upon login, but I would like to have the Admin form update images and their associated link URLs on the UserDashboard.

Basically, the Admin form will control the content available for users to select and send out via SMS (twilio).

Should I use a Globals module to store the image sources and links? A data table?

Basic setup - I have 8 images components, nested inside 8 link components. Each of these containers also have a checkbox component to “select” the images associated URL.

As user selects their image, I’m updating a list of the URLs as they go. If they chose 5 out of the 8 images/links, they can send out an SMS with those 5 links.

The admin dashboard will have the ability to update the image/link choices for the User Dashboard. I was thinking of using a Fileloader for them to upload a new image, or maybe just another image component. then the link can be updated via a text input.

Thoughts on the best way to do this?

Hi there,

I try to use Data Tables where possible since Anvil provides a lot of built-in convenience.

In your Admin page you could try using a DataGrid component to list your content. For each row you could add an “edit” button so that you can edit a list of associated Users, and something similar to add/remove content.

In your Data Tables service, perhaps you could have a “Content” table. Your Users table could have a column that links (joins) to rows in your Content table. Any changes to the Admin page would of course update the Content table and the linked column in the Users table.

There are many ways to design such a set up. This is just what comes to mind.

For design ideas, the CRUD DataGrid and staff portal example may be helpful. I wrote a staff portal with an Admin page as well, and perhaps that might also help to generate ideas.

1 Like