# Get shape by ID

1. You can use a shape’s unique `ShapeId` to update or control that shape on a slide.

### Finding the ID of a shape:

Unfortunately, PowerPoint does not display a shape’s ID in the user interface. There are two workarounds:&#x20;

* Programmaticall&#x79;**:**&#x20;
  * using VBA or any library capable of reading PowerPoint XML (e.g., `python-pptx`).
* Manually:
  * Rename the `.pptx` file to `.zip`.
  * Open the ZIP and navigate to `ppt/slides/slideX.xml`.
  * Inside, look for any `<p:sp>`, `<p:pic>`, or similar shape element.
  * Each shape contains a `<p:cNvPr>` tag, its `id` attribute represents the shape’s unique ID.

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2FSQdM50pQWi6A26G6ottw%2Fshapeid.png?alt=media&#x26;token=0bd479d1-5505-4ae7-b129-903655ebf899" alt=""><figcaption></figcaption></figure>

Reference: [shapes](https://docs.powerpointgeneratorapi.com/json-template-syntax/shapes "mention")

Download: [input.zip](https://drive.google.com/uc?export=download\&id=1lg3VvGtF3lq_4lGIiBd79l23zSRmdsni) | [output.pptx](https://drive.google.com/uc?export=download\&id=1Uy6jmd5cnWqs2OZrVFdO4uqrp7YXswDo)

{% columns %}
{% column width="41.66666666666667%" %}

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2FXwzt9UBuNEVBlF0pkvbj%2Ftemplate.png?alt=media&#x26;token=e0d5d86a-4e0a-4d0b-a1d4-3ff6380c4fea" alt=""><figcaption></figcaption></figure>

***

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2F5H1VGbwxKYBBWpvZOlTT%2Foutput.png?alt=media&#x26;token=c0c219d9-96de-4ece-90cd-0b5e18f68049" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="58.33333333333333%" %}
{% code lineNumbers="true" %}

```json
{
    "presentation": {
        "template": "template.pptx",
        "slides": [
            {
                "slide_index": 0,
                "shapes": [
                    {
                        "shapeId": 6,
                        "data": [
                            ["Q1", "Q2", "Q3", "Q4"],
                            ["Product A", "Product B", "Product C", "Product D"],
                            [45, 32, 20, 18],
                            [55, 40, 30, 22],
                            [60, 48, 36, 28],
                            [72, 55, 42, 35]
                        ]
                    }
                ]
            }
        ]
    }
}

```

{% endcode %}
{% endcolumn %}
{% endcolumns %}
