Removing an item from a list

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.

Screenshot 2022-06-01 at 2.38.21 PM

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?

Ok, I’ve used a select box to output the fields and I can see that I’m not actually saving them correctly. When you enter multiple items separated by a space, it groups them all together like so (apologies for the unoriginal names!) -

Screenshot 2022-06-01 at 3.24.00 PM

Sorry to tag you @mikeloc - but do you know how I’d rectify this? Is it a simple case of adding a space in to my regex after every new line?

Very easy.
Set state of the the value.

Delete a thing in the workflow. To search that deleted thing use that states value.

[Calendly - Ali Imran ]Take a five min call to solve the bug

Thanks for replying @hafizaliimrankhan - So instead of of “Make a change to thing”, I should in fact use “Set State”?

Would you like to save it in db?

Yes, I want to save a list of departments for a team in the DB which I’m currently doing.

Quick thing. Will solve it for free
[Calendly - Ali Imran ]

This topic was automatically closed after 70 days. New replies are no longer allowed.