function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Peter CowenPeter Cowen 

remove string in variable in a flow

I am looking into the possibilty of creating a flow that will remove a part of a string inside a variable or field but I am unsure how to do it. 

I currently have a flow that updates a text field with 'hello' on the service contract when a record in another object is created. It also adds 'hello' to the end of the field if it is already populated. 

I would like to introduce a flow that will check whether the record is marked as closed where it will then remove 'hello' and replace with 'bye'. 

I would also like it to remove the 'hello' if the status of the record is marked as retained. 

How would I go about doing it? I would prefer not to add any additional fields
Guilherme Nigoski 9Guilherme Nigoski 9
Peter, I was crossing a similar issue. I am populated a email collection variable in a flow. Before I add my decision component I already populated the variable, but there is one decision that I should clean the variable and assume other values.

In my solution, I did the work around by creating a new variable named as "EmptyEmail". Then when the flow enter in the decision that I should clean the email collection, I made a atribution to EmptyEmail then I created other atribution to the new email.

I used this link: https://trailhead.salesforce.com/pt-BR/trailblazer-community/feed/0D54S00000A8GuASAV