WebView.GetSourceData
---------------------

Queries the source data from the web viewer.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [2.1](newinversion21.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.GetSourceData"; WebViewerRef { ; FileName } ) 

**MBS**( **"WebView.GetSourceData";** /\* Queries the source data from the web viewer. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function.e.g. "web" \*/   
**$FileName**) /\* Optional; The filename to use for the container.e.g. "test.pdf" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. | "web" |  |
| FileName | The filename to use for the container. | "test.pdf" | Optional |

### Result

The data in the webviewer as a container value. For example for a PDF document, the PDF document is returned.

### Description

Queries the source data from the web viewer.   
If you provide a filename, we'll use this name for the container value. But if you provide a name, your name will be used.  
For some media the data is not available for the plugin, so you can query the URL using [WebView.GetURL](WebViewGetURL.md) and download it yourself.  
### See also

- [WebView.FindByName](WebViewFindByName.md)
- [WebView.GetSource](WebViewGetSource.md)
- [WebView.GetURL](WebViewGetURL.md)

### Release notes

- **Version 13.3**
    - Fixed [WebView.GetSourceData](https://www.mbsplugins.eu/WebViewGetSourceData.shtml) to return empty result if no data is available.

### Example Databases

- [WebViewer/Data from URL](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Data%20from%20URL.shtml#1GroupButton588.00000006.0000000613.000000085.0000000LayoutObjectAnchor_)
- [WebViewer/WebViewer Save PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Save%20PDF.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 13.3pr2](https://www.mbsplugins.de/archive/2023-06-13/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.2pr4](https://www.mbsplugins.de/archive/2014-04-22/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.2pr4](https://www.mbsplugins.de/archive/2010-11-15/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 6th June 2023

  
[WebView.GetSource](WebViewGetSource.md) - [WebView.GetTitle](WebViewGetTitle.md)

[HTML Version](WebViewGetSourceData.shtml)