Removing values from fields

Hi,

using the below i am able to append values in to a single field .

<$action-listops $field="tobeappendedto" $subfilter=<<valuetoappend>>/>

Now i need to reverse that, how can i search for a value in a field and remove it , keeping in mind that some of the appended values are wrapped in double brackets [[ ]]

so if i have a field “tobeappendedto” Value = X Y [[X YZ]]
and another field “value to be removed” = Y

wow can i get Y removed with an action

field mangler removes taggs , and the remove operator i guess might be the other option , but i am honestly not sure how to use it

Try this:

<$let value="Y">
<$button>append
<$action-listops $field="somefield" $subfilter="[<value>]"/>
</$button>
<$button>remove
<$action-listops $field="somefield" $subfilter="-[<value>]"/>
</$button>
4 Likes

Eric’s given you the answer, but I’d just like to highlight that you can also add and subtract values from the same field within the same $action-listops widget, in case this is useful to you.

The $action-listops documentation is a bit dense and I remember struggling to grasp the distinctions myself, but essentially the widget takes the current value of “tobeappendedto,” modifies it based on $subfilter (which could be a single value or a complicated filter), and writes the output of that filter back to the field. This is in contrast with $filter, which deletes the current value of “tobeappendedto” and replaces it with the output of $filter.

So if “tobeappendedto” = X Y [[X YZ]], the following are functionally equivalent:

<$action-listops $field="tobeappendedto" $subfilter="-[[X YZ]]">
<$action-listops $field="tobeappendedto" $filter="X Y [[X YZ]] -[[X YZ]]">

The listops operators given in the documentation are all intended to be used within the subfilter, but you are not restricted to those operators.

1 Like

thank you for your replies ,I totally missed the part in the documentation where it shows examples for clearing fields using a " - ", I guess the other thing was to use a <$let or or a <$Set as the values i am appending/removing are not static

this is what worked for me

<$let value={{!!valuetoappend}}>
<$button>remove
<$action-listops $field="tobeappendedto" $subfilter="-[<value>]"/>
</$button>

Thanks again for the info and happy holidays