Hi,
I’m trying to create a ‘filters’ array for cs.search, however am running into difficulties as follows:
It works fine if I assign it some key:value pairs. For example:
1. let filters = [{"field_path":":PRO0000136GBJZS1","value":"1","comparator":"starts"}];
However, I want to use a variable. For example:
2. let filters = [myVariable];
The variable has exactly the same syntax as above, in other words: {“field_path”:“:PRO0000136GBJZS1”,“value”:“1”,“comparator”:“starts”}
But it does not work.
In Detective, the array returned by (1) is:
Array
(
[0] => Array
(
[field_path] => :PRO0000136GBJZS1
[value] => 1
[comparator] => starts
)
)
The array returned by (2) is:
Array
(
[0] => {“field_path”:“:PRO0000136GBJZS1”,“value”:“1”,“comparator”:“starts”}
)
Thanks for any help.
Mark