Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Social.Accounts

Queries an array of all the accounts in an account database.

Component Version macOS Windows Linux Server iOS SDK
Social 5.3 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes

Deprecated

This function was deprecated.

MBS( "Social.Accounts" { ; Type } )   More

Parameters

Parameter Description Example Flags
Type The type of accounts to find. If not provided or empty, all account types are used. Can be Twitter, Facebook, SinaWeibo, TencentWeibo or LinkedIn.
LinkedIn is macOS only and not available on iOS.
"Twitter" Optional

Result

Returns list of identifiers or error.

Description

Queries an array of all the accounts in an account database.
Works only on macOS with 64-bit FileMaker.
Added iOS support for plugin version 7.3.

Examples

List Twitter Accounts

Go to Layout [“Accounts” (Accounts)]
Delete All Records [No dialog]
Set Variable [$list; Value:MBS( "Social.Accounts"; "Twitter" )]
If [MBS("IsError")]
    Show Custom Dialog ["Error finding accounts"; $list]
Else
    Set Variable [$count; Value:ValueCount ( $list )]
    If [$count > 0]
        Set Variable [$i; Value:1]
        Loop
            Set Variable [$accountIdentifier; Value:GetValue ( $list ; $i )]
            New Record/Request
            Set Field [Accounts::Identifier; MBS( "Social.AccountProperty"; $accountIdentifier; "Identifier" )]
            Set Field [Accounts::Description; MBS( "Social.AccountProperty"; $accountIdentifier; "Description" )]
            Set Field [Accounts::Username; MBS( "Social.AccountProperty"; $accountIdentifier; "username" )]
            Set Field [Accounts::Type; MBS( "Social.AccountProperty"; $accountIdentifier; "accountType" )]
            Commit Records/Requests [No dialog]
            Set Variable [$i; Value:$i + 1]
            Exit Loop If [$i >= $count]
        End Loop
    End If
End If

Post on Twitter:

Set Variable [$accounts; Value:MBS( "Social.Accounts"; "Twitter")]
Set Variable [$accountIdentifier; Value:GetValue($accounts; 1)]
If [$accountIdentifier = ""]
    Show Custom Dialog ["No Twitter account allowed?"]
Else
    Set Variable [$request; Value:MBS( "SocialRequest.New"; "Twitter"; "https://api.twitter.com/1.1/statuses/update.json"; "POST" )]
    Set Variable [$r; Value:MBS( "SocialRequest.AddParameter"; $request; "status"; Tweets::Message )]
    Set Variable [$r; Value:MBS( "SocialRequest.SetAccount"; $request; $accountIdentifier)]
    Set Variable [$r; Value:MBS( "SocialRequest.Perform"; $request; Get(FileName); "TweetCompleted" )]
End If

See also

Example Databases

This function is free to use.

Created 28th August 2015, last changed 10th August 2020


Social.AccountProperty - Social.HasAccessForAccountType