Hi all, I’m trying to remove a value from a list and I’m wondering if anyone can point me in the right direction.
Background and problem
I have a database named ‘Team’ and in that I have a field named “Department” which is a list of texts - .i.e - IT, Marketing, HR, etc.
An admin can add different Departments using a multiline input box. You can add one department at a time or multiple departments if they use a new line. The way I’ve done this is by using a regex like so -
That is all working exactly how I want it.
However, deleting/remove an item is a little trickier. If I use the multiline input to add just one department, it allows me to remove that item when I press the delete button (x). When I use the multiline input to add more than one departments, it does not let me delete/remove any of the items. The way I’m removing item is like so -
Can anyone point out where I’m going wrong? I thought it may have something to do with the regex adding unnecessary data to the DB? But apart from a missing space before the next comma .ie. - IT, Marketing, HR - I can’t see any difference. Has anyone else run in to the same problem that could point me in the right direction?