Can I access App-data metafields in the App Embed Blocks?

Solved

Can I access App-data metafields in the App Embed Blocks?

JuanVan
Shopify Partner
2 1 0

Hi, I am using App Embed Blocks, and I want to embed some dynamic content in them.

Can I store values through App-data metafields and then access them in the block?

For example:

 

<div style="position: fixed; bottom: 0; right: 0">
    {{ app.metafields.namespace_test.key_test }}
</div>
{% schema %}
  {
    "name": "App Embed",
    "target": "body",
    "settings": []
  }
{% endschema %}

 

I have created a metafield for the app using Admin GraphQL according to this example document. After testing, I actually got an empty string. If I can’t access `app.metafields` within the blocks, is there any other way to access the custom variables of the application?

I would be grateful for a response.

Accepted Solution (1)

JuanVan
Shopify Partner
2 1 0

This is an accepted solution.

The problem has been solved. The cause of the issue was an incorrect accessToken, which belonged to another App.

View solution in original post

Reply 1 (1)

JuanVan
Shopify Partner
2 1 0

This is an accepted solution.

The problem has been solved. The cause of the issue was an incorrect accessToken, which belonged to another App.