SocialRequest.SetAccount
------------------------

Sets the account to use for this request.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Social](component_Social.md) | [5.3](newinversion53.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "SocialRequest.SetAccount"; Request; accountIdentifier ) 

**MBS**( **"SocialRequest.SetAccount";** /\* Sets the account to use for this request. \*/  
**$Request**; /\* The reference number for the social request as you got it from [SocialRequest.New](SocialRequestNew.md) function. \*/   
**$accountIdentifier**) /\* The ID for the account. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Request | The reference number for the social request as you got it from [SocialRequest.New](SocialRequestNew.md) function. | $request |
| accountIdentifier | The ID for the account. |  |

### Result

Returns OK or error.

### Description

Sets the account to use for this request.  
### Examples

Post on Twitter:

 Set Variable \[$accounts ; Value:MBS ( "[Social.Accounts](SocialAccounts.md)"; "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](SocialRequestNew.md)"; "Twitter"; "https://api.twitter.com/1.1 /statuses/update.json"; "POST" )\]  
 Set Variable \[$r ; Value:MBS ( "[SocialRequest.AddParameter](SocialRequestAddParameter.md)"; $request ; "status"; Tweets::Message )\]  
 Set Variable \[$r ; Value:MBS ( "SocialRequest.SetAccount"; $request ; $accountIdentifier )\]  
 Set Variable \[$r ; Value:MBS ( "[SocialRequest.Perform](SocialRequestPerform.md)"; $request ; Get(FileName); "TweetCompleted" )\]  
End If  
### See also

- [Social.Accounts](SocialAccounts.md)
- [SocialRequest.AddParameter](SocialRequestAddParameter.md)
- [SocialRequest.GetAccount](SocialRequestGetAccount.md)
- [SocialRequest.New](SocialRequestNew.md)
- [SocialRequest.Perform](SocialRequestPerform.md)

### Example Databases

- [Mac only/Tweet on Twitter](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Tweet%20on%20Twitter.shtml#5ScriptAnchor_)

This function is free to use.

Created 28th August 2015 , last changed 12nd June 2020

  
[SocialRequest.Release](SocialRequestRelease.md) - [SocialRequest.SetRequestMethod](SocialRequestSetRequestMethod.md)

[HTML Version](SocialRequestSetAccount.shtml)