Is there a way to do a query in an expression using a string of a datatype, for example : “systemversions~n_systemchange#3c916451-d9fd-4bd4-8397-7de8e5fe0afc”.
Usecase: in the recordtype ExportDatasets, there is a plugin field called data_type. This returns a string like the one above. I want to then query the table of that recordtype.
Ah right, yes you can also do that, in processes. You can use the EvaluateExpression or (in some cases) ExpressionToolsEvaluateView actions from the Expression Tools plug-in for that as they accept expression strings.
You can build the expression string around the type name from the field with Concat blocks, for example
As a best practice, avoid using hard coded field and type names in such expressions, because the problem visitor and call tree will not be able detect that fields are being used there. (You can however use this, id, createdat, createdby, modifiedat, modifiedby, old(), load(…) and other default fields and functions.)
I don’t know if this is on topic and if it’s allowed to continue on solved questions. Anyways:
I currently have and extra_where from a process using expressionstools plugin, but how does this string expression work in the application?
F.e. I have need to filter my incoming class (organizations in this case) on multiple conditions but it expects a string:
Hi @Jesse ,
What you have here is a String extensions plugin, validated expression field.
This field seems to be configured to contain an expression that evaluates to a string. The expression i can see in your picture evaluates to a list of contact records.
Here is a short explanation of the expression structure:
{
table_to_look_up, (in your case, contacts)
value_to_return, (in your case “this” means return record reference
where_condition (in your case you have 3 conditions, all of them which have to be true so you get a record)
}
then - the curly braces, means a list.
If your use case is the same as Joerie’s (you intend to put that expression into an EvaluateExpression action within a process, what you can do is to take the relevant part of the provided expression and wrap it in quotes. In this case, i assume you need the where part only, so you can modify the expression to:
“boolean:and([this.is_sales_contact.equals(yesno:load(1)), etc etc ])”
the " " would make it behave as a literal string which you can further pass into the EvaluateExpression as Wim described above.