How can I collect values of the removed tags in an array or datastore to use on the server-side

Hello,

I have setup a tagify input field to select users from the available list of staff. The tagify component works correctly when posting values via a server connect form.

However, I have run into an issue when users are deleted from the tagify input. I'm trying to collect a list of user_ids in a local datastore when an existing tag is removed from the input field.

When I remove a tag, instead of getting the user_id of the removed tag, I get a list of the user_ids that remain in the input field. If I remove another tag, then an additional record is inserted in the datastore with the remaining user_ids in the input field, and this continues until all the tags have been removed.

I want to collect the user_id that has been removed. How can I collect these values in a tagify input field? Any help in this matter is greatly appreciated.

<input id="u_id" name="u_id" type="text" class="form-control form-control-sm border-success" style="font-size: 0.7rem;" is="dmx-tagify" dmx-bind:data="sc_list_portal_staff.data.rpt_portal_staff_u_id" tag-text="ud_name+' ('+ud_email+')'" tag-value="u_id" nocustom="true" required="" data-msg-required="Minimum 1 staff is required." max-items="20" min-chars="0" dmx-bind:value="sc_list_class_products_staff_assigned.data.arr_list_staff.values(`u_id`)" dmx-on:remove="run({run:{outputType:'text',action:`ds_u_id_deleted.insert({user_id: value})`}})">

The remove event returns the removed tag value in the data picker:

1 Like

Hi Teodor,

Is it an event of tagify? When I click on Dynamic Events -> Tagify -> Remove under properties, I don't see the Remove Event -> value under Data Bindings.

Update: I can see the Remove Events. It was my mistake, I hadn't added any action for it to become available.