We have a list of persons (normal master/detail) and each person has a number of fields in the detail view. We now have a use case that we want to fill the same field for all persons in that list (ca. 500) in a fast way, meaning not opening the detail view of each person, find the field, fill it, save and go to the next person. Kind of like you would fill an Excel list by simply moving down. The field to be filled does vary, so the user would need to be able to select the field in a first step.
The three ideas for the data entry would be
- a list view with one line per person, each line with the field person (name) and the selected field to fill
- a modal/reduced detail view with only the field to fill for one person and a fast navigation between this person-specific reduced detail views
- import of an excel file/csv file and mapping of data (but we have repeats, so not straight forward)
Has anyone implemented something similar or does know it from an A12 application?
We have a project where bulk operations that depend on one input were implemented in an overview.
The overview has multi-select enabled. It additionally has a component above the header. There is a dropdown to select the bulk operation to execute (see “1” in image above) and an input for the parameter (see “2” in image above).the operation expects. Based on the operation the parameter is a number or date.
When executing the operation a custom endpoint is posted to in our implementation. But one could also use a custom rpc operation or create an rpc operation with many partial document modifications.
Thank you, but you fill always the same value in this field right? So a mass operation to change the field value for the selected entries to the same number or date?
We would have individual values for each person.
Hi @linda-steep-rush
Mapping might solve your problem. You might be able to:
- Create a new document with a repeat which contains a Name Field as well as Fields for the values you want to change
- Enter the data in the Frontend with a Form as normal
- Save the data and let Mapping match the Names to existing Names in the database and map the new values as defined in the Mapping Model.
I’m not an expert in this new, still experimental, feature so I’ve asked @felix-blazing-river to take a look and he’ll add some more details.
Hey @linda-steep-rush,
there is not much to add to @malcolm-silver-ice’s suggestions. This is a very good usecase for the Mapping.
I would suggest the following: A button in the Bulk Operations/Multiselect of the Overview, that takes the csv and gives both, the list of selected docRefs and the csv to a custom server endpoint. The endpoint would then:
- read in the csv and create a (not persisted) document of AdditionalInfos_DM and validate it
- iterate thru the list of docRefs and
- get the persisted document
- give this and the document with the additional info to the Mapper
- persist the changed document
After its done, you could reload the overview.
You can fully model the Mapper: Which Field of AdditionalInfos_DM is mapped onto which Field of Person_DM and how they are found (probably an ID).
This works also well with nested repeat structures. So one Column of the csv could represent a Field in one repetition of Addresses (where role=“home address”) and another column could write into a different repetition of the same Addresses repeatable Group (where role=“shipping address”). So you could map from a flat list into a nested repeat structure in a defined way.
Reading in the csv to a defined document of AdditionalInfos_DM first, give you also the advantage of type checking before the actual data transfer. So you could fail early in the process and not leave you enduser with inconsistent data