I have changed but still not getthing it. here is my complete code and my use case here is to search either by title or by comoanyName or by ContactName but this is not working…tried to check if this is getting into relevant if esle block then results shows that it getting only title block which does not contain the searchInfo that is actually in byContactName block
my_variables[“param”] = url_parameters[“data”];
//Now we need to make search either by ‘Title’ or ‘Roof Top Name’ or by ‘Primary Contact Name’(which is hidden) in ‘Rooftops’
if(my_variables[“param”]!=“”){
//Search by ‘Account Title’
my_variables[“byTitle”] = ‘[{“field_id”: “604993”,“field_type”: “single_text”,“match_type”: “contains”,“values”: [{“value”:"’+ my_variables[‘param’] +‘"}],“type”: “text”}]’;
//Search by ‘Roof Top Name’
my_variables[“byRTName”] = ‘[{“field_id”: “564681”,“field_type”: “single_text”,“match_type”: “contains”,“values”: [{“value”:"’+ my_variables[‘param’] +‘"}],“type”: “text”}]’;
//Search by ‘Primary Contact Name’
my_variables[“byContactName”] = ‘[{“field_id”: “681651”,“field_type”: “calculation”,“match_type”: “contains”,“values”: [{“value”:"’+ my_variables[‘param’] +‘"}],“type”: “calculation”}]’;
if (my_variables[“byTitle”]!==“”) {
// client needs to search from whole Accounts not just by the Logged In User Accounts
custom_tokens.roof = json_encode([
[
“field_id” => “604993”,
“field_type” => “single_text”,
“match_type” => “contains”,
“values” => [[“value” => my_variables[“param”]]],
“type” => “text”
]
]);
print ‘entered to title’;
} elseif (my_variables[“byRTName”]!==“”) {
print ‘entered to rtName’;
// client needs to search from whole Accounts not just by the Logged In User Accounts
custom_tokens.roof = ‘[{“field_id”: “564681”,“field_type”: “single_text”,“match_type”: “contains”,“values”: [{“value”:"’+ my_variables[‘param’] +‘"}],“type”: “text”}]’;
} elseif (my_variables[“byContactName”]!==“”) {
// client needs to search from whole Accounts not just by the Logged In User Accounts
print ‘entered to companyName’;
custom_tokens.roof = ‘[{“field_id”: “681651”,“field_type”: “calculation”,“match_type”: “contains”,“values”: [{“value”:"’+ my_variables[‘param’] +‘"}],“type”: “calculation”}]’;
}
}