Form processing to update metadata


(Serge) #1

Matrix Version:

Hi,

How would I approach the following:

  1. List all users under a user group
  2. That list is also a form which allows me to display drop down menus (select) for the admin to change values
  3. Press submit and update all the metadata for those listed users

ex:

NAME    DEPARTMENT    TRAINING     DATE ACTIVE
----------------------------------------------------------------------------------
Bob        IT                       [none]           [-]
Serge     IT                       [intranet]        [2017-06-16]
Felix       HR                     [intranet]        [2016-01-01]
....
Celine     Accounts            [intranet]        [2017-03-02]

[SUBMIT] 

So what is within bracket in the listing would be sourced from the user type asset metadata field into a select / drop down menu, and on submitting that form, update all the users metadata.

I don’t necessarily need the details but just pointers. Would I use a custom form with a trigger? Or is that just doable through using the Javascript API? Do you have any example of something close to this that I can look at?

Thanks


(Bart Banda) #2

Yep, I’d use the JS API. https://matrix.squiz.net/manuals/web-services/chapters/javascript-api
Using the JS API you can also do a batch update so that you make one JS API call that updates several assets at once.

You could potentially have a submit button next to each user as well that only gets activated whenever you change one of their fields. But that’s more of a UI preference for you to make.

You could alternatively link each user to their URL with /_edit to launch a simple edit layout, or even just Edit+ view of them and linked directly to the Metadata screen, but that would only allow you to edit one user at a time, so your original mockup might be better if you want to do bulk updates.