I can’t figure out how to pass the value of the item I’m removing from a tagify field to the server connect so I can delete it from the database.
I added the message so I could see what was coming out but get an error in the console.
bootstrap-modbox.min.js:30 Uncaught (in promise) Error: The “body” or “message” configuration option is required (string).
at new modbox (bootstrap-modbox.min.js:30:1251)
at bootstrap-modbox.min.js:12:1859
at new Promise ()
at #buildPromiseModal (bootstrap-modbox.min.js:12:1831)
at modbox.alert (bootstrap-modbox.min.js:41:620)
at bootbox.alert (dmxBootbox5.js:7:3611)
at n._execStep (dmxAppConnect.js:7:46750)
at dmxAppConnect.js:7:46179
My process is slightly different. I don’t remove anything when a tag is removed, I process the array when the form is submitted and my SC script updates the field which is a JSON field so it just has the new, remaining tags in it.
If you store each one in a separate m2m record then I would delete them all when the form is submitted and then add the ones left again. Hope that makes sense!
Thanks @sitestreet. My tags are actually quite complex (multi levels) so I have a modal that opens up when the field gets focus to select/deselect as needed. That does as you suggest with deleting all the tags and add the ones left selected.
With this, however, I want the user to be able to just click the x on the tag to delete it quickly without opening up the modal. As I can’t get anything to happen when the x is clicked there’s no way to submit a form or run a server connect.
I see no issue with passing the removed item value. Tested this and it works perfectly fine.
Are you sure you pass the removed item value when calling the dynamic event:
In the remove I want to delete the removed item from the database. Right now I’m just trying to get the value of the removed item into the message to confirm it’s working. I don’t have that Remove Event listed in the data bindings.
I still don’t see what exactly have you selected as a value for your remove dynamic event. Please provide some more detailed screenshots as it’s not really clear for me what are you doing exactly.
I did it that way originally because I have a few things I need to do with that ID, including running some custom javascript. I just changed that to a simple action and the Remove Event is there. Phew.
I can probably work around my other things by using the success from a server action but shouldn’t that Remove Event be in the data bindings in a flow just like it is in the simple actions?
Ok i see what you mean, seems in the flows the $event data is not available in the data picker.
You can still access it like: $event.value in the data picker (code view):