filemaker_record_updater/
filemaker_record_updater.rs

1use filemaker_lib::Filemaker;
2use anyhow::Result;
3use serde_json::Value;
4use std::collections::HashMap;
5
6#[tokio::main]
7async fn main() -> Result<()> {
8    std::env::set_var("FM_URL", "https://fm.example.com/fmi/data/vLatest"); // Replace with actual filemaker server url
9    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    // Record ID to update
16    let record_id = 123; // Replace with the actual record ID
17
18    // Data to update
19    let mut field_data = HashMap::new();
20    field_data.insert("fieldName".to_string(), Value::String("new_value".to_string())); // Replace "fieldName" and "new_value"
21
22    // Update the record
23    let result = filemaker.update_record(record_id, field_data).await?;
24    println!("Update Result: {:?}", result);
25
26    Ok(())
27}