Filter records by Calculation Field

Hi, I have a use case where I got Names from multiple referenced field in a calculation field Now I want to perform filter on base of name from calculation field and using the text as on API it is said ‘Refer to the individual field types as the calculation field expects the same filtering format for these different types.’ Filter | Tape Developers
but this is not working. here is my code
custom_tokens.roof = ‘[{“field_id”: “681651”,“field_type”: “multi_text”,“match_type”: “contains”,“values”: [{“value”:"’+ my_variables[‘param’] +‘"}],“type”: “text”}]’;


@Jason if you could help? TIA

@Sameer

Not 100% sure this is what you are trying to do but hopefully it is close enough to get you in the right direction it is a little early to write so I will try and show with pictures:



{
  "filters": [
    {
      "field_id": "543118",
      "field_type": "calculation",
      "match_type": "contains",
      "values": [
        {
          "value": "Jason"
        }
      ],
      "type": "calculation"
    }
  ]
}

1 Like

Thanks @jason
I can see this works when directly API is called but I am actually using this filter Filter | Tape Developers
in my ProcFu. Have used for other fields and they are working but for calculation, not getting if I am doing something wrong.

Okay so I assume ProcFu formats its filters in the same way. However in your code you have field_type”: “multi_text” if you are filtering on a calculation field that needs to be "field_type": "calculation", as in my example.

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”}]’;
}
}