Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
CNContact.JSON
Queries contact as JSON.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Contacts | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |
MBS( "CNContact.JSON"; ContactIdentifier { ; SkipImage } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
ContactIdentifier | The contact identifier. | "46B1E34D-58F9-4B6B-A80D-0F71ABB87A0E" | |
SkipImage | Available in MBS FileMaker Plugin 8.5 or newer. If you pass 1, we skip the images. Default is 0 to include images. |
1 | Optional |
Result
Returns JSON or error.
Description
Queries contact as JSON.If the application is not properly code signed with entitlements, you may only get limited data like no phone numbers.
Examples
Query your JSON:
MBS( "CNContact.JSON"; MBS( "CNContactStore.UnifiedMeContact" ) )
Get formatted and colored JSON:
Set Variable [ $json ; Value: MBS( "CNContact.JSON"; MBS( "CNContactStore.UnifiedMeContact" ) ) ]
Set Variable [ $json ; Value: MBS("JSON.Colorize"; MBS( "JSON.Format"; $json) ) ]
Set Field [ Contacts::Result ; $json ]
Get JSON of a person:
Let([
contacts = MBS( "CNContactStore.ContactsMatchingName"; "Christian Schmitz" );
contactID = GetValue(contacts; 1);
json = MBS( "CNContact.JSON"; contactID; 1 )
];json)
See also
- CNContact.AddEmailAddress
- CNContact.AddPhoneNumber
- CNContact.Name
- CNContactStore.AddContact
- CNContactStore.Contacts
- CNContactStore.ContactsMatchingName
- CNContactStore.NewContact
- CNContactStore.UnifiedMeContact
- JSON.Colorize
- JSON.Format
Release notes
- Version 13.4
- Fixed exception for CNContact.JSON function.
- Version 13.2
- Added identifier value to the JSON returned by CNContact.JSON function.
- Version 8.5
- Added SkipImage parameter for CNContact.JSON function.
Example Databases
Blog Entries
- MBS FileMaker Advent calendar - Door 5 - Apple Contacts
- MBS FileMaker Plugin, version 13.4pr3
- MBS FileMaker Plugin, version 13.2pr2
- MBS FileMaker Plugin, version 8.5pr1
Created 1st August 2018, last changed 9th February 2022