I am making a register for a group of people where everybody has their own login and dashboard.
In this register will also be some children where the parents want to have the right to change their data. To put it into an example:
Within the same form.
Parent (ID 22) wants to change some data from child 1 (ID 59)
Parent (ID 22) changes Field ID 93 (first name) which should change Field ID 9 from Child 1 (ID 59)
The same for Field ID 91 and Field ID 92 which should change the field IDs 22 and 23 of the Child (User ID 59).
More perfectly I would find a solution where, within the same form, this could be done for multiple children. This situation would count for different families.
The parents can't be administrators.
The main cause is, that the register can be downloaded to a CSV and every single entry (child and parent) will have its own line in the file at the same row (first name, last name, etc.). If there is a solution using multiple forms, that would also be fine, as long as one CSV with all the most up-to-date data can be downloaded.
I hope this is possible via an PHP code snippet. I tried to write it with ChatGPT, but that didn't work out so far.
Use a single form with a repeater field for the children. Repeater fields are examples of embedded forms. You create a view to display your data and you can export your view.
Thanks Victor. I eventually solved it by making a separate entry (for each child) since I needed the export to have all the data (from parents and children) in the same columns.
I gave logged in users the ability to alter other users data.
When a parent is logged in they see only their children via a hidden parent ID which corresponds with another hidden child ID in order to make an unique view.
Within this view I made use of the front-end editing shortcode for only the fields that I want them to be able to change.
Please login or Register to submit your answer