Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1    Statistic  


Sets the value of a given property for a record.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Addressbook 3.1 Yes No Yes, macOS only No Yes

MBS( "Addressbook.record.SetValueForProperty"; RecordID; PropertyName; Value )


Parameter Description Example value
RecordID The unique ID for the target person or group. $personID
PropertyName The name of the property. "EmailProperty"
Value The value as text, date or number. $value


Returns OK on success and error on failure.


Sets the value of a given property for a record.
For multivalue items, please use an empty string as value and the plugin will put in the current multivalue.
Possible property names are UIDProperty, CreationDateProperty, ModificationDateProperty, FirstNameProperty, LastNameProperty, FirstNamePhoneticProperty, LastNamePhoneticProperty, NicknameProperty, MaidenNameProperty, BirthdayProperty, BirthdayComponentsProperty, OrganizationProperty, JobTitleProperty, HomePageProperty, URLsProperty, CalendarURIsProperty, EmailProperty, AddressProperty, OtherDatesProperty, OtherDateComponentsProperty, RelatedNamesProperty, DepartmentProperty, PhoneProperty, AIMInstantProperty, JabberInstantProperty, MSNInstantProperty, YahooInstantProperty, ICQInstantProperty, InstantMessageProperty, SocialProfileProperty, NoteProperty, MiddleNameProperty, MiddleNamePhoneticProperty, TitleProperty, SuffixProperty and GroupNameProperty.


Set first name on a person:

MBS( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; Addressbook::FirstName )

Add a new URL to a contact:

Set Variable [$r; MBS( "Addressbook.multivalue.New") ]
Set Variable [$ID; MBS( "Addressbook.multivalue.addValue"; ""; "WorkLabel" ) ]
Set Variable [$r; MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $ID ) ]
Set Variabel [$r; MBS( "Addressbook.record.SetValueForProperty"; $personID; "URLsProperty"; "multivalue" ) ]

Add work and home emails:

$r = MBS( "Addressbook.multivalue.New" )
$WorkEmailID = MBS( "Addressbook.multivalue.addValue"; Addressbook::WorkEmail; "EmailWorkLabel" )
$HomeEmailID = MBS( "Addressbook.multivalue.addValue"; Addressbook::HomeEmail; "EmailHomeLabel" )
$r = MBS( "Addressbook.multivalue.setPrimaryIdentifier"; $WorkEmailID )
$r = MBS( "Addressbook.record.SetValueForProperty"; $personID; "EmailProperty"; "multivalue" )

Set flags, so entry shows as company:

MBS( "Addressbook.record.SetValueForProperty"; $personID; "PersonFlags"; 1 )

Edit existing person:

# get an UUID for a person record
$personID = "637FA922-7A2B-4F9A-BFA3-023253D4A3D5:ABPerson"
# set a new name
$r = MBS( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; "John" )
# save it
$r = MBS( "" )

Replace an email:

# find my ID
Set Variable [$personID; Value:MBS( "" )]
# get email list
Set Variable [$r; Value:MBS( "Addressbook.record.valueForProperty"; $personID; "EmailProperty" )]
# show first email in list
Set Variable [$firstValue; Value:MBS( "Addressbook.multivalue.valueAtIndex"; 0 )]
Show Custom Dialog ["First Email"; $firstValue]
# replace first email with new email
Set Variable [$r; Value:MBS( "Addressbook.multivalue.replaceValueAtIndex"; 0; "test@test.test" )]
# show changed email
Set Variable [$firstValue; Value:MBS( "Addressbook.multivalue.valueAtIndex"; 0 )]
Show Custom Dialog ["First Email"; $firstValue]
# set back the email list
Set Variable [$r; Value:MBS( "Addressbook.record.SetValueForProperty"; $personID; "EmailProperty"; "" )]
# save it
Set Variable [$r; Value:MBS( "" )]
Show Custom Dialog ["Saved"; $r]

Add first and last name:

Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "FirstNameProperty"; $vn )]
Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "LastNameProperty"; $nn )]

Set organization:

Set Variable [$result; Value:MBS ( "Addressbook.record.SetValueForProperty"; $personID; "OrganizationProperty"; $org )]

See also

Example Databases

Addressbook.personFromVCardTextRepresentation   -   Addressbook.record.UniqueID

Feedback: Report problem or ask question.

MBS Xojo Plugins