Filter Results
If you are using one of our SDKs to develop your integration you have multiple choices when you want to filter the responses of our Api, you can write your query manually or you can use our Filter Helper to build the filter.
In this example, we'll suppose you have to manage just one Company, so we simply inserted its ID directly in the code. If instead, you need to be able to manage multiple companies, you'll need to retrieve the ID of the current company in some way. Check the Company-scoped Methods page for more info.
๐งย Building the filter manuallyโ
If you have to filter an Api response and your query is not very complicated, the most straightforward approach you can use is the manual one, you simply have to set the request's q parameter to the desired filter query and you are ready to go.
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
using System;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;
namespace Example
{
public class ListClientsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ClientsApi(config);
var companyId = 12345;
var fieldset = "detailed";
var q = "vat_number = '03812340161'";
try
{
ListClientsResponse result = apiInstance.ListClients(companyId, null, fieldset, null, null, null, q);
Console.Write(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling ClientsApi.ListClients: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
}
}
}
package main
import (
"context"
"encoding/json"
"fmt"
"os"
fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
"github.com/fattureincloud/fattureincloud-go-sdk/v2/filter"
)
func main() {
companyId := int32(2)
q := "vat_number = '03812340161'"
auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "YOUR_ACCESS_TOKEN")
configuration := fattureincloudapi.NewConfiguration()
apiClient := fattureincloudapi.NewAPIClient(configuration)
resp, r, err := apiClient.ClientsAPI.ListClients(auth, companyId).Q(q).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ClientsAPI.ListClients``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListClients`: ListClientsResponse
json.NewEncoder(os.Stdout).Encode(resp)
condition := filter.NewCondition
}
import it.fattureincloud.sdk.ApiClient;
import it.fattureincloud.sdk.ApiException;
import it.fattureincloud.sdk.Configuration;
import it.fattureincloud.sdk.auth.*;
import it.fattureincloud.sdk.model.*;
import it.fattureincloud.sdk.api.ClientsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
OAuth OAuth2AuthenticationCodeFlow = (OAuth) defaultClient.getAuthentication("OAuth2AuthenticationCodeFlow");
OAuth2AuthenticationCodeFlow.setAccessToken("YOUR_ACCESS_TOKEN");
ClientsApi apiInstance = new ClientsApi(defaultClient);
Integer companyId = 2;
String fieldset = "detailed";
String q = "vat_number = '03812340161'";
try {
ListClientsResponse result = apiInstance.listClients(companyId, null, fieldset, null, null, null, q);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ClientsApi#listClients");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
const fattureInCloudSdk = require("@fattureincloud/fattureincloud-js-sdk");
let defaultClient = fattureInCloudSdk.ApiClient.instance;
let OAuth2AuthenticationCodeFlow =
defaultClient.authentications["OAuth2AuthenticationCodeFlow"];
OAuth2AuthenticationCodeFlow.accessToken = "YOUR_ACCESS_TOKEN";
let apiInstance = new fattureInCloudSdk.ClientsApi();
let companyId = 12345;
let opts = {
fieldset: "detailed",
q: "vat_number = '03812340161'",
};
apiInstance.listClients(companyId, opts).then(
(result) => {
console.log(result);
},
(error) => {
console.error(error);
}
);
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = FattureInCloud\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new FattureInCloud\Api\ClientsApi(
new GuzzleHttp\Client(),
$config
);
$company_id = 12345;
$fieldset = 'detailed';
$q = "vat_number = '03812340161'";
try {
$result = $apiInstance->listClients($company_id, null, $fieldset, null, null, null, $q);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ClientsApi->listClients: ', $e->getMessage(), PHP_EOL;
}
import fattureincloud_python_sdk
from fattureincloud_python_sdk.api import clients_api
from pprint import pprint
configuration = fattureincloud_python_sdk.Configuration()
configuration.access_token = "YOUR_ACCESS_TOKEN"
with fattureincloud_python_sdk.ApiClient(configuration) as api_client:
api_instance = clients_api.ClientsApi(api_client)
company_id = 12345
fieldset = "detailed"
q = "vat_number = '03812340161'"
try:
api_response = api_instance.list_clients(company_id, fieldset=fieldset, q=q)
pprint(api_response)
except fattureincloud_python_sdk.ApiException as e:
print("Exception when calling ClientsApi->list_clients: %s\n" % e)
require 'time'
require 'fattureincloud_ruby_sdk'
FattureInCloud_Ruby_Sdk.configure do |config|
config.access_token = 'YOUR_ACCESS_TOKEN'
end
api_instance = FattureInCloud_Ruby_Sdk::ClientsApi.new
company_id = 12345
opts = {
fieldset: 'detailed',
q: "vat_number = '03812340161'"
}
begin
result = api_instance.list_clients(company_id, opts)
p result
rescue FattureInCloud_Ruby_Sdk::ApiError => e
puts "Error when calling ClientsApi->list_clients: #{e}"
end
const apiConfig = new Configuration({
accessToken: "YOUR_ACCESS_TOKEN",
});
let apiInstance = new ClientsApi(apiConfig);
let companyId = 2;
let q = "vat_number = '03812340161'";
apiInstance
.listClients(
companyId,
undefined,
"detailed",
undefined,
undefined,
undefined,
q
)
.then(
(data) => {
console.log(data);
},
(error) => {
console.error(error);
}
);
You can set the Access Token in the dedicated section, for more informations look here.
๐ย Using the Filter Helperโ
If you have a long and articulated query or you are building your filter programmatically then your best option is to use our Filter Helper that you can find in each one of our official SDKs.
Conditionโ
The Condition class is the underlying principle of our Helper, it's made up of 3 properties, the Field, the Operator and the Value
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
var condition = new Condition<string>("vat_number", Operator.EQ, "03812340161");
var query = condition.BuildQuery(); // "vat_number = '03812340161'"
condition := filter.NewCondition("vat_number", filter.Operators.EQ, "03812340161")
query := condition.BuildQuery() // "vat_number = '03812340161'"
Condition<String> condition = new Condition<>("vat_number", Operator.EQ, "03812340161");
String query = condition.buildQuery(); // "vat_number = '03812340161'"
var condition = new Condition("vat_number", Operator.EQ, "03812340161");
var query = condition.buildQuery(); // "vat_number = '03812340161'"
$condition = new Condition('vat_number', Operator::EQ, '03812340161');
$query = $condition->buildQuery(); // "vat_number = '03812340161'"
condition = Condition(field="vat_number", op=Operator.EQ, value="03812340161")
query = condition.build_query() # "vat_number = '03812340161'"
condition = FattureInCloud_Ruby_Sdk::Condition.new('vat_number', FattureInCloud_Ruby_Sdk::Operator::EQ, '03812340161')
query = condition.build_query # "vat_number = '03812340161'"
var condition = new Condition("vat_number", Operator.EQ, "03812340161");
var query = condition.buildQuery(); // "vat_number = '03812340161'"
Operatorโ
There are many operators you can utilize in a Condition:
Operator Name | Symbol |
---|---|
EQ | '=' |
GT | '>' |
GTE | '>=' |
LT | '<' |
LTE | '<=' |
NEQ | '<>', '!=' |
IS | '=' |
IS_NOT | '!=' |
LIKE | 'like' |
NOT LIKE | 'not like' |
CONTAINS | 'contains' |
NOT CONTAINS | 'not contains' |
STARTS_WITH | 'starts with' |
ENDS_WITH | 'ends with' |
Conjunction & Disjunctionโ
The Conjunction and Disjunction classes work like logical operators between two Conditions, the Conjunction works like the AND operator while the Disjunction works like the OR operator.
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
var condition1 = new Condition<string>("vat_number", Operator.EQ, "03812340161");
var condition2 = new Condition<string>("tax_code", Operator.EQ, "RSSMRG99A23206D");
var disjunction = new Disjunction(condition1, condition2);
var query = disjunction.BuildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
condition1 := filter.NewCondition("vat_number", filter.Operators.EQ, "03812340161")
condition2 := filter.NewCondition("tax_code", filter.Operators.EQ, "RSSMRG99A23206D")
disjunction := filter.NewDisjunction(condition1, condition2)
query := disjunction.BuildQuery() // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
Condition<String> condition1 = new Condition<>("vat_number", Operator.EQ, "03812340161");
Condition<String> condition2 = new Condition<>("tax_code", Operator.EQ, "RSSMRG99A23206D");
Disjunction disjunction = new Disjunction(condition1, condition2);
String query = condition.buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
var condition1 = new Condition("vat_number", Operator.EQ, "03812340161");
var condition2 = new Condition("tax_code", Operator.EQ, "RSSMRG99A23206D");
var disjunction = new Disjunction(condition1, condition2);
var query = disjunction.buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
$condition1 = new Condition('vat_number', Operator::EQ, '03812340161');
$condition2 = new Condition('tax_code', Operator::EQ, 'RSSMRG99A23206D');
$disjunction = new Disjunction($condition1, $condition2);
$query = $disjunction->buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
condition1 = Condition(field="vat_number", op=Operator.EQ, value="03812340161")
condition2 = Condition(field="tax_code", op=Operator.EQ, value="RSSMRG99A23206D")
disjunction = Disjunction(left=condition1, right=condition2)
query = disjunction.build_query() # (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
condition1 = FattureInCloud_Ruby_Sdk::Condition.new('vat_number', FattureInCloud_Ruby_Sdk::Operator::EQ, '03812340161')
condition2 = FattureInCloud_Ruby_Sdk::Condition.new('tax_code', FattureInCloud_Ruby_Sdk::Operator::EQ, 'RSSMRG99A23206D')
disjunction = FattureInCloud_Ruby_Sdk::Disjunction.new(condition1, condition2)
query = disjunction.build_query # (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
var condition1 = new Condition("vat_number", Operator.EQ, "03812340161");
var condition2 = new Condition("tax_code", Operator.EQ, "RSSMRG99A23206D");
var disjunction = new Disjunction(condition1, condition2);
var query = disjunction.buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
DSLโ
There is another way to use our Filter Helper, you can indeed use out Domain-Specific language as shown in the next steps.
Whereโ
To initialize a Filter you must set a Where condition, you have 2 options:
Where(field, operator, value)โ
In this method you have to pass the field, operator and value as shown in the following examples:
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
var filter = new Filter();
filter.Where("vat_number", Operator.EQ, "03812340161");
var query = filter.BuildQuery(); // vat_number = '03812340161'
filterObj := filter.NewEmptyFilter()
filterObj.Where("vat_number", filter.Operators.EQ, "03812340161")
query := filterObj.BuildQuery() // vat_number = '03812340161'
Filter filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
String query = filter.buildQuery(); // vat_number = '03812340161'
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
var query = filter.buildQuery(); // vat_number = '03812340161'
$filter = new Filter();
$filter->where('vat_number', Operator::EQ, '03812340161');
$query = $filter->buildQuery(); // "vat_number = '03812340161'"
filter = Filter()
filter.where_condition(field="vat_number", op=Operator.EQ, value="03812340161")
query = filter.build_query() # vat_number = '03812340161'
filter = FattureInCloud_Ruby_Sdk::Filter.new()
filter.where('vat_number', FattureInCloud_Ruby_Sdk::Operator::EQ, '03812340161')
query = filter.build_query # vat_number = '03812340161'
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
var query = filter.buildQuery(); // vat_number = '03812340161'
WhereExpression(condition|conjunction|disjunction)โ
In this method you can either pass a simple condition or a more complex conjunction or disjunction as shown below:
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
var condition1 = new Condition<string>("vat_number", Operator.EQ, "03812340161");
var condition2 = new Condition<string>("tax_code", Operator.EQ, "RSSMRG99A23206D");
var disjunction = new Disjunction(condition1, condition2);
var filter = new Filter();
filter.WhereExpression(disjunction);
var query = filter.BuildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
condition1 := filter.NewCondition("vat_number", filter.Operators.EQ, "03812340161")
condition2 := filter.NewCondition("tax_code", filter.Operators.EQ, "RSSMRG99A23206D")
disjunction := filter.NewDisjunction(condition1, condition2)
filterObj := filter.NewEmptyFilter()
filterObj.WhereExpression(disjunction)
query := disjunction.BuildQuery() // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
Condition<String> condition1 = new Condition<>("vat_number", Operator.EQ, "03812340161");
Condition<String> condition2 = new Condition<>("tax_code", Operator.EQ, "RSSMRG99A23206D");
Disjunction disjunction = new Disjunction(condition1, condition2);
Filter filter = new Filter();
filter.whereExpression(disjunction);
String query = filter.buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
var condition1 = new Condition("vat_number", Operator.EQ, "03812340161");
var condition2 = new Condition("tax_code", Operator.EQ, "RSSMRG99A23206D");
var disjunction = new Disjunction(condition1, condition2);
var filter = new Filter();
filter.whereExpression(disjunction);
var query = filter.buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
$condition1 = new Condition('vat_number', Operator::EQ, '03812340161');
$condition2 = new Condition('tax_code', Operator::EQ, 'RSSMRG99A23206D');
$disjunction = new Disjunction($condition1, $condition2);
$filter = new Filter();
$filter->whereExpression($disjunction);
$query = $filter->buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
condition1 = Condition(field="vat_number", op=Operator.EQ, value="03812340161")
condition2 = Condition(field="tax_code", op=Operator.EQ, value="RSSMRG99A23206D")
disjunction = Disjunction(left=condition1, right=condition2)
filter = Filter()
filter.where_expression(disjunction)
query = filter.build_query() # (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
condition1 = FattureInCloud_Ruby_Sdk::Condition.new('vat_number', FattureInCloud_Ruby_Sdk::Operator::EQ, '03812340161')
condition2 = FattureInCloud_Ruby_Sdk::Condition.new('tax_code', FattureInCloud_Ruby_Sdk::Operator::EQ, 'RSSMRG99A23206D')
disjunction = FattureInCloud_Ruby_Sdk::Disjunction.new(condition1, condition2)
filter = FattureInCloud_Ruby_Sdk::Filter.new()
filter.where_expression(disjunction)
query = filter.build_query # (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
var condition1 = new Condition("vat_number", Operator.EQ, "03812340161");
var condition2 = new Condition("tax_code", Operator.EQ, "RSSMRG99A23206D");
var disjunction = new Disjunction(condition1, condition2);
var filter = new Filter();
filter.whereExpression(disjunction);
var query = filter.buildQuery(); // (vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D')
And & Orโ
If you need a more complex filter you can add an and or or condition to your Filter you have 3 options:
And(field, operator, value) & Or(field, operator, value)โ
In this method you have to pass the field, operator and value as shown in the following examples:
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
var filter = new Filter();
filter.Where("vat_number", Operator.EQ, "03812340161");
filter.Or("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.Or("code", Operator.CONTAINS, "2022/");
var query = filter.BuildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains '2022/')
filterObj := filter.NewEmptyFilter()
filterObj.Where("vat_number", filter.Operators.EQ, "03812340161")
filterObj.Or("tax_code", filter.Operators.EQ, "RSSMRG99A23206D")
filterObj.Or("code", filter.Operators.CONTAINS, "2022/")
query := filterObj.BuildQuery() // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains '2022/')
Filter filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
filter.or("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.or("code", Operator.CONTAINS, "2022/");
String query = filter.buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
filter.or("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.or("code", Operator.CONTAINS, "2022/");
var query = filter.buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
$filter = new Filter();
$filter->where('vat_number', Operator::EQ, '03812340161');
$filter->or('tax_code', Operator::EQ, 'RSSMRG99A23206D');
$filter->or('code', Operator::CONTAINS, '2022/');
$query = $filter->buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
filter = Filter()
filter.where_condition(field="vat_number", op=Operator.EQ, value="03812340161")
filter.or_condition(field="tax_code", op=Operator.EQ, value="RSSMRG99A23206D")
filter.or_condition(field="code", op=Operator.CONTAINS, value="2022/")
query = filter.build_query() # ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
filter = FattureInCloud_Ruby_Sdk::Filter.new()
filter.where('vat_number', FattureInCloud_Ruby_Sdk::Operator::EQ, '03812340161')
filter.or('tax_code', FattureInCloud_Ruby_Sdk::Operator::EQ, 'RSSMRG99A23206D')
filter.or('code', FattureInCloud_Ruby_Sdk::Operator::CONTAINS, '2022/')
query = filter.build_query # ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
filter.or("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.or("code", Operator.CONTAINS, "2022/");
var query = filter.buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
AndExpression(condition|conjunction|disjunction) & OrExpression(condition|conjunction|disjunction)โ
In this method you can either pass a simple condition or a more complex conjunction or disjunction as shown below:
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
var condition1 = new Condition<string>("tax_code", Operator.EQ, "RSSMRG99A23206D");
var condition1 = new Condition<string>("code", Operator.CONTAINS, "2022/");
var filter = new Filter();
filter.Where("vat_number", Operator.EQ, "03812340161");
filter.OrExpression(condition1);
filter.OrExpressiom(condition2);
var query = filter.BuildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains '2022/')
condition1 := filter.NewCondition("vat_number", filter.Operators.EQ, "03812340161")
condition2 := filter.NewCondition("code", filter.Operators.CONTAINS, "2022/")
filterObj := filter.NewEmptyFilter()
filterObj.Where("vat_number", filter.Operators.EQ, "03812340161")
filterObj.AndExpression(condition1)
filterObj.AndExpression(condition2)
query := filterObj.BuildQuery() // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
Condition<String> condition1 = new Condition<>("tax_code", Operator.EQ, "RSSMRG99A23206D");
Condition<String> condition2 = new Condition<>("code", Operator.CONTAINS, "2022/");
Filter filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
filter.orExpression(condition1);
filter.orExpression(condition2);
String query = filter.buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
var condition1 = new Condition("tax_code", Operator.EQ, "RSSMRG99A23206D");
var condition2 = new Condition("code", Operator.CONTAINS, "2022/");
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
filter.orExpression(condition1);
filter.orExpression(condition2);
var query = filter.buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
$condition1 = new Condition('tax_code', Operator::EQ, 'RSSMRG99A23206D');
$condition2 = new Condition('code', Operator::CONTAINS, '2022/');
$filter = new Filter();
$filter->where('vat_number', Operator::EQ, '03812340161');
$filter->orExpression($condition1);
$filter->orExpression($condition2);
$query = $filter->buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
condition1 = Condition(field="tax_code", op=Operator.EQ, value="RSSMRG99A23206D")
condition2 = Condition(field="code", op=Operator.CONTAINS, value="2022/")
filter = Filter()
filter.where_condition(field="vat_number", op=Operator.EQ, value="03812340161")
filter.or_expression(condition1)
filter.or_expression(condition2)
query = filter.build_query() # ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
condition1 = FattureInCloud_Ruby_Sdk::Condition.new('tax_code', FattureInCloud_Ruby_Sdk::Operator::EQ, 'RSSMRG99A23206D')
condition2 = FattureInCloud_Ruby_Sdk::Condition.new('code', FattureInCloud_Ruby_Sdk::Operator::CONTAINS, '2022/')
filter = FattureInCloud_Ruby_Sdk::Filter.new()
filter.where('vat_number', FattureInCloud_Ruby_Sdk::Operator::EQ, '03812340161')
filter.or_expression(condition1)
filter.or_expression(condition2)
query = filter.build_query # ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
var condition1 = new Condition("tax_code", Operator.EQ, "RSSMRG99A23206D");
var condition2 = new Condition("code", Operator.CONTAINS, "2022/");
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
filter.orExpression(condition1);
filter.orExpression(condition2);
var query = filter.buildQuery(); // ((vat_number = '03812340161' or tax_code = 'RSSMRG99A23206D') or code contains'2022/')
AndFilter(filter) & OrFilter(filter)โ
In this method you have to pass a Filter object as shown here:
- C#
- Go
- Java
- JavaScript
- PHP
- Python
- Ruby
- TypeScript
var filter = new Filter();
filter.Where("vat_number", Operator.EQ, "03812340161");
var filter1 = new Filter();
filter1.Where("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.AndFilter(filter1);
var query = filter.BuildQuery(); // (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
filterObj := filter.NewEmptyFilter()
filterObj.Where("vat_number", filter.Operators.EQ, "03812340161")
filterObj1 := filter.NewEmptyFilter()
filterObj1.Where("tax_code", filter.Operators.EQ, "RSSMRG99A23206D")
filterObj.AndFilter(*filterObj1)
query := filterObj.BuildQuery() // (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
Filter filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
Filter filter1 = new Filter();
filter1.where("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.andFilter(filter1);
String query = filter.buildQuery(); // (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
var filter1 = new Filter();
filter1.where("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.andFilter(filter1);
var query = filter.buildQuery(); // (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
$filter = new Filter();
$filter->where('vat_number', Operator::EQ, '03812340161');
$filter1 = new Filter();
$filter1->where('tax_code', Operator::EQ, 'RSSMRG99A23206D');
$filter->andFilter($filter1);
$query = $filter->buildQuery(); // (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
filter = Filter()
filter.where_condition(field="vat_number", op=Operator.EQ, value="03812340161")
filter1 = Filter()
filter1.where_condition(field="tax_code", op=Operator.EQ, value="RSSMRG99A23206D")
filter.and_filter(filter1)
query = filter.build_query() # (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
filter = FattureInCloud_Ruby_Sdk::Filter.new()
filter.where('vat_number', FattureInCloud_Ruby_Sdk::Operator::EQ, '03812340161')
filter1 = FattureInCloud_Ruby_Sdk::Filter.new()
filter1.where('tax_code', FattureInCloud_Ruby_Sdk::Operator::EQ, 'RSSMRG99A23206D')
filter.and_filter(filter1)
query = filter.build_query # (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
var filter = new Filter();
filter.where("vat_number", Operator.EQ, "03812340161");
var filter1 = new Filter();
filter1.where("tax_code", Operator.EQ, "RSSMRG99A23206D");
filter.andFilter(filter1);
var query = filter.buildQuery(); // (vat_number = '03812340161' and tax_code = 'RSSMRG99A23206D')
Now that your query is ready the last thing to do is to set the q parameter equal to the just obtained query and you are ready to make your request!