--- title: "system.historian.storeMetadata" description: "Store a list of metadata to the specified historian." --- # system.historian.storeMetadata > Store a list of metadata to the specified historian. This function is used in **Python Scripting**. ## Description Store a list of metadata to the specified historian. This function applies to the Core Historian and Internal Historian only. Metadata can be provided as individual parameter lists or as objects created with [system.historian.types.metadataPoint](appendix/scripting-functions/system-historian/types/system-historian-types-metadataPoint.md). When provided as individual parameter lists, ensure all parameters are 1:1, meaning all provided lists must be of the same length. If a particular annotation doesn't need a parameter, that element can be None in the list. ## Client Permission Restrictions This scripting function has no [Client Permission](ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax #1 `system.historian.storeMetadata(paths, timestamps, properties)` ### Parameters |Type| Parameter| Description| |--|--|--| |List| `paths`|A list of historical paths. See [Path Syntax](appendix/scripting-functions/system-historian/system-historian.md#path-syntax) for more information on recommended syntax.| |List |`timestamps` |A list of timestamps. **Note**: It is possible to store two datapoints with the same timestamp with the Core Historian. If this occurs, the trends will use the highest value point for interpolation. However, it is **not** recommended to attempt storing two points with identical timestamps. | |Dictionary |`properties` |A dictionary of desired properties to be stored as historical metadata, entered as defined key-value pairs corresponding to any relevant tag properties.| ### Returns **List** - A list of [QualityCode](appendix\reference-pages\scripting-object-reference\scripting-object-reference.md#qualitycode) objects. The quality code will indicate success or failure. ### Scope Gateway, Vision Client, Perspective Session ## Syntax #2 `system.historian.storeMetadata(metadata)` ### Parameters |Type| Parameter| Description| |--|--|--| |List |`metadata` |A list of metadata point objects created with `system.historian.types.metadataPoint`. | ### Returns **List** - A list of [QualityCode](appendix\reference-pages\scripting-object-reference\scripting-object-reference.md#qualitycode) objects. The quality code will indicate success or failure. ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet 1: Syntax #1" # Store a single property to a specified historical tag path and log an info level formatted message. paths = ["histprov:Historian:/sys:gw1:/prov:default:/tag:remote_200"] curr = system.date.now() timestamps = [curr] properties = { "tooltip": "changing with perspective"} results = system.historian.storeMetadata(paths, timestamps, properties) system.util.getLogger('HistorianTest: storeMetadata').info(str(results)) ``` ```python title="Code Snippet 2: Syntax #1" # Store a list of properties to a specified historical tag path. qualityCodes = system.historian.storeMetadata( paths=["histprov:CoreHistorian:/sys:gateway:/prov:default:/tag:Folder/MyTag"], timestamps=[system.date.now()], properties={ "engUnit": "degF", "engLow": 0.0, "engHigh": 500.0, "documentation": "Main reactor temperature sensor", "calibrationDate": "2024-01-15" } ) ``` ```python title="Code Snippet 1: Syntax #2" # Create metadata using the types API and store it source = "histprov:CoreHistorian:/sys:gateway:/prov:default:/tag:Folder/MyTag" properties = {"tooltip":"metadata text"} timestamp = system.date.now() metaDataPoints = [system.historian.types.metadataPoint(source, properties, timestamp)] system.historian.storeMetadata([metadata]) ```