Broadly speaking, here's what I'm trying to do: Parse a string in one cell of a spreadsheet, then add keywords to another cell in that row if certain keywords are found in the parsed cell.
I'm using OpenRefine (technically Google Refine 2.5) to try to do this, using the "Add a column based on this column" feature, and I've yet to have anything actually show up in the new column.
Here's the current iteration of the GREL expression I'm working with:
if (contains(cells["dates and codes"].value,"beef"), cells["protein"].value +=" beef", "")
It's throwing the following error:
Parsing error at offset 77: Missing number, string, identifier, regex, or parenthesized expression
I'm new to this software and to GREL, but my searching hasn't turned up this sort of string function. (I think I now have a better idea of how to reference specific cells, but I suppose that could also be the issue.)
A. Is this possible?, and
B. Is there a more efficient way to do this than scripting a bunch of if(contains()) statements?