filemaker_search_results_output/
filemaker_search_results_output.rs1use anyhow::Result;
2use filemaker_lib::Filemaker;
3use serde_json::Value;
4use std::collections::HashMap;
5
6#[tokio::main]
7async fn main() -> Result<()> {
8 Filemaker::set_fm_url("https://fm.example.com/fmi/data/vLatest")?; let username = "your_username";
10 let password = "your_password";
11 let database = "your_database";
12 let table = "your_table";
13 let filemaker = Filemaker::new(username, password, database, table).await?;
14
15 let mut query = HashMap::new();
17 query.insert("fieldName".to_string(), "example_value".to_string()); let sort_fields = vec!["fieldName".to_string()]; let ascending = true;
22
23 let records = filemaker
24 .search::<Value>(vec![query], sort_fields, ascending, Some(10))
25 .await?;
26 println!("Search Results:");
27 for record in records.response.data {
28 println!("{:?}", record);
29 }
30
31 Ok(())
32}