Rule Engine for text with quotes

Hi all!
I need use Rule Engine node for text field containing quotes
For example:
I have:

Filial (column name)
Filial “Moscow”
Filial “Saint Petersburg”
Other

I need:

Filial (column name)
Main office
Second office
Other

Expression
$Filial$ = “Filial “Moscow”” = > “Main office”
$Filial$ = “Filial “Saint Petersburg”” = > “Second office”
causes the expected error:
“excepted =>”

I tried also
$Filial$ = “Filial “Moscow”” = > “Main office”
$Filial$ = “Filial “Saint Petersburg”” = > “Second office”
but that didn’t help.

Please help me and sorry for bad English.

Hi,

Preprocess field Filial by “String Manipulation” node with function which removes quotes:

replace($Filial$,"\"" ,"")

Then apply rule like $Filial$ = “Filial Moscow” => “Main Office”

Martin K.

Thanks for advice! But it is not perfect decision: preprocessing will change all values, not only values I want to change. I have an idea how I can to finalize your sentence: replacing quotes for any word, the manipulation I need and reverse replacing. But I don’t like this decision, it seems unnatural and too complex to me.

Hi,
depending on your data you could use wildcards instead of quotes:
$Filial$ = “Filial *Moscow*” = > “Main office”
$Filial$ = “Filial *Saint Petersburg*” = > “Second office”
should work fine, it is just assuming that you do not have some cells with important information between Filial and the city name like:
“Filial XY “Moscow”” and “Filial “Moscow””, because of course that would retrieve both cells.

Thank you for the advice! It’s acceptable in my case. But I used “LIKE” instead of “=” in condition:
$Filial$ LIKE “Filial Moscow” = > “Main office”
$Filial$ LIKE “Filial Saint Petersburg” = > “Second office”
Other decision I found is just using third-party file (created in Excel, for example) containing list of principles of changing and left joining it. It’s suitable for more complicated cases.
UPD: Asterisks in forum message disappear and leave italics instead. :slight_smile:

You can either indent your preformated text with four spaces:

$Filial$ = “Filial *Moscow*” = > “Main office”

or by sorrounding it with back-ticks:

```
 $Filial$ LIKE “Filial Moscow” = > “Main office”
```

to prevent all of the markdown styling.
best,
Gabriel

I just used a backslash before the first asteriks that worked as well :wink: