# Update Metadata from external json without javascript.

**URL:** <https://community.hubspot.com/t/update-metadata-from-external-json-without-javascript/61165>\
**Category:** CMS Development\
**Tags:** design-manager\
**Created:** [July 18, 2022, 4:20pm UTC](https://community.hubspot.com/t/update-metadata-from-external-json-without-javascript/61165 "2022-07-18T16:20:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [July 18, 2022, 4:20pm UTC](https://community.hubspot.com/t/update-metadata-from-external-json-without-javascript/61165/1 "2022-07-18T16:20:51Z")

</div>

Is there a way to create dynamic metadata tags from an external json file into a template without using javascript? I the tag to be updated before page load.  
For example:  
\<meta property=“og:title” content=“{{[json.data](http://json.data/).firstname}}'s page”/\>

\<meta property=“og:image” content=“{{[json.data](http://json.data/).imageurl}}”/\>

That way facebook, twitter, etc would be able to read it?

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [July 19, 2022, 4:30pm UTC](https://community.hubspot.com/t/update-metadata-from-external-json-without-javascript/61165/2 "2022-07-19T16:30:46Z")

</div>

I think the only way to do this is with a [server side function](https://developers.hubspot.com/docs/cms/data/serverless-functions), or bring the JSON file into your website if you can; you could have it as a partial HTML file with the json (or at least an object array) set to a HubL variable, then import the partial wherever you need it e.g. below. A third option would be to push the JSON data to a HubDB and then pull the data for your page from there.

Partial file:

```lia-code-sample
<!--
 templateType: page
 isAvailableForNewContent: false
-->
<!-- Begin partial -->
{% set objects = [{"firstname":"john", "lastname":"doe"},{"firstname":"jane", "lastname":"deer"}] %}
<!-- End partial -->

```

Usage:

```lia-code-sample
{% include '/path_to_partial/json_partial.html' %}
{% for obj in objects %}
{{obj.firstname}}
{% endfor %}

```

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [July 19, 2022, 4:36pm UTC](https://community.hubspot.com/t/update-metadata-from-external-json-without-javascript/61165/3 "2022-07-19T16:36:48Z")

</div>

Thank you. Is there a way to pass in the json to the variable from a url?

`{% set objects = getJson("https://example.com/json") %}`

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [July 21, 2022, 9:17am UTC](https://community.hubspot.com/t/update-metadata-from-external-json-without-javascript/61165/4 "2022-07-21T09:17:50Z")

</div>

No, I don’t think that’s possible as it’s mixing server side and client side. You can get local Hubspot assets/files with {{ get\_asset\_url() }}; and you can assign the result of HubL to a JS variable, but not the other way round (so you can’t, for example, fetch the JSON url and assign it to a HubL variable). If you want to use this JSON data as metadata, presumably it’s your own file so why can’t you simply upload it to Hubspot?

Unless I’ve missed something @dennisedson?
