CURL.SetFinishedEvaluate
------------------------

Sets expression to be run when transfer is finished.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [6.1](newinversion61.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetFinishedEvaluate"; curl; Expression ) 

**MBS**( **"CURL.SetFinishedEvaluate";** /\* Sets expression to be run when transfer is finished. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Expression**) /\* The expression to evaluate.  
Can be in local language of FileMaker Pro or english.   
For Server must always be in english.e.g. "Let ( $$Done = 1 ; 1 )" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Expression | The expression to evaluate.   Can be in local language of FileMaker Pro or english.    For Server must always be in english. | "Let ( $$Done = 1 ; 1 )" |

### Result

Returns OK or error.

### Description

Sets expression to be run when transfer is finished.  
Works with [CURL.Perform](CURLPerform.md), [CURL.PerformAsync](CURLPerformAsync.md) and [CURL.PerformInBackground](CURLPerformInBackground.md).  
  
In the expression the text $$ID$$ will be replaced when evaluated with the curl reference, so you can pass it to other functions if needed.  
The finish script and evaluate run after failed/succeed scripts and evaluates.  
### Examples

Sets expression to run when transfer is done:

 Set Variable \[ $result ; Value: MBS ( "CURL.SetFinishedEvaluate"; $curl ; "Let ( $$Done = 1 ; 1 )" ) \]  
Free curl session when done:

 # Start new session   
Set Variable \[ $curl ; Value: MBS ("[CURL.New](CURLNew.md)") \]   
\# Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)   
Set Variable \[ $result ; Value: MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; CURL Test::URL ) \]   
Set Variable \[ $result ; Value: MBS ( "CURL.SetFinishedEvaluate"; $curl ; "MBS (\\"[CURL.Release](CURLRelease.md)\\"; $$ID $$)" ) \]   
\# RUN now   
Set Field \[ CURL Test::Result ; MBS ("[CURL.PerformInBackground](CURLPerformInBackground.md)"; $curl ) \]  
### See also

- [CURL.GetFailedEvaluate](CURLGetFailedEvaluate.md)
- [CURL.GetFinishedEvaluate](CURLGetFinishedEvaluate.md)
- [CURL.GetFinishedFileName](CURLGetFinishedFileName.md)
- [CURL.New](CURLNew.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.PerformAsync](CURLPerformAsync.md)
- [CURL.Release](CURLRelease.md)
- [CURL.SetFailedEvaluate](CURLSetFailedEvaluate.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)
- [CURL.SetSucceededEvaluate](CURLSetSucceededEvaluate.md)

### Release notes

- **Version 9.5**
    - Fixed crash with freeing curl connection from evaluate in [CURL.SetFinishedEvaluate](http://www.mbsplugins.eu/CURLSetFinishedEvaluate.shtml) function.

### Example Databases

- [CURL/CURL and OnWindowTransaction](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20and%20OnWindowTransaction.shtml#1ScriptAnchor_)

### Blog Entries

- [Background Log Custom function](https://www.mbsplugins.de/archive/2024-01-09/Background_Log_Custom_function/monkeybreadsoftware_blog_filemaker)
- [Send Audit Log via CURL in background](https://www.mbsplugins.de/archive/2023-11-30/Send_Audit_Log_via_CURL_in_bac/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.5pr1](https://www.mbsplugins.de/archive/2019-10-02/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.1pr5](https://www.mbsplugins.de/archive/2016-03-06/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)
- [Evaluate vs. Script Trigger](https://www.mbsplugins.de/archive/2016-03-04/Evaluate_vs_Script_Trigger/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 4th March 2016 , last changed 27th December 2023

  
[CURL.SetFailedScript](CURLSetFailedScript.md) - [CURL.SetFinishedScript](CURLSetFinishedScript.md)

[HTML Version](CURLSetFinishedEvaluate.shtml)