How to convert an string with array form to an array?
<p>I got a string in this form</p>

<pre><code>payload = ["Text 1", "Text 2"]
</code></pre>

<p>I want to use <code>Text 2</code> as an object. How can I return it? </p>

<p><strong>UPDATE</strong>
I'm making a function which returns a <a href="https://developers.facebook.com/docs/messenger-platform/send-api-reference/receipt-template" rel="nofollow">generic template</a> Facebook API. 
The first <code>payload</code> works well, but I want to return a <code>string</code> and a <code>object</code> in the second <code>payload</code> ( result )</p>

<pre><code>button = [
            {
                "type": "postback",
                "title": "Buy item",
                "payload": "Buy this item: " + (product['id'])
            },
            {
                "type": "postback",
                "title": "Add to wishlist",
                "payload": result
            }
        ]
</code></pre>

<p>My second payload should look like this:</p>

<pre><code>payload = {
            'Order_item',
            product['title']
        }
</code></pre>

<p>Because I got this error <code>[buttons][1][payload] must be a UTF-8 encoded string</code> so I did convert it and it returns a <strong>STRING</strong> in this form <code>["Order_item", "Ledverlichting Fiets Blauw"]</code></p>

<p>Because I want that when a Facebook user clicks on a postback ( Add to wishlist ), the <code>product['title']</code> value will be save in Django database. And <code>product['title']</code> is the <code>Text 2</code> in the question above.</p>

<p>you can try:</p>

<pre><code>&gt;&gt;&gt; payload = ["t1", "t2"]
&gt;&gt;&gt; t2 = [1,2]
&gt;&gt;&gt; eval(payload[1])
[1, 2]
</code></pre>

python arrays django string