<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get and update field value on GUI from python backend ? in Dev Space</title>
    <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/610397#M1302</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/81266"&gt;@WarGot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also looking for the same thing if it is possible. So, do you have any suggestions now if you have implemented it on your end?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciable!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2020 17:01:40 GMT</pubDate>
    <dc:creator>RuchikaMangla</dc:creator>
    <dc:date>2020-07-27T17:01:40Z</dc:date>
    <item>
      <title>How to get and update field value on GUI from python backend ?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/397823#M824</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;May be someone help me with development custom alteryx tool on python.&lt;/P&gt;&lt;P&gt;Can't find how to change GUI values from python -(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frontend:&lt;/P&gt;&lt;PRE&gt;    &amp;lt;section&amp;gt;
        &amp;lt;h2&amp;gt;1. Choice file&amp;lt;/h2&amp;gt;
        &amp;lt;ayx aria-label="data-source-metainfo-filebrowse" data-ui-props='{type:"FileBrowse", widgetId:"dataSourceFilePath", fileTypeFilters: "Askia QES file|*.qes|Askia QEW file|*.qew|All Files|*.*", placeholder:"Select Askia file"}' data-item-props='{dataName: "browseFile", dataType:"SimpleString"}'&amp;gt;&amp;lt;/ayx&amp;gt;
    &amp;lt;/section&amp;gt;

    &amp;lt;section&amp;gt;
        &amp;lt;h2&amp;gt;2. Choice tables and fields&amp;lt;/h2&amp;gt;
        &amp;lt;ayx data-ui-props='{type:"ListBox", widgetId:"Tables", heightAuto: true}' data-item-props='{dataName: "tree"}'&amp;gt;&amp;lt;/ayx&amp;gt;
    &amp;lt;/section&amp;gt;&lt;/PRE&gt;&lt;P&gt;Backend:&lt;/P&gt;&lt;PRE&gt;class AyxPlugin:
.....
    def pi_init(self, str_xml: str):
        """
        Handles extracting user-entered file name, and input data verification.
        Called when the Alteryx engine is ready to provide the tool configuration from the GUI.
        :param str_xml: The raw XML from the GUI.
        """

        # Getting the user-entered file name string from the GUI, and the output anchor from the XML file.
        self.file_path = Et.fromstring(str_xml).find('browseFile').text if 'browseFile' in str_xml else ''
        self.tables = Et.fromstring(str_xml).find('tablesList').text if 'tablesList' in str_xml else 'EMPTY'&lt;/PRE&gt;&lt;P&gt;self.tables is always EMPTY - it's incorrect&lt;BR /&gt;In str_xml also does not have any passed values.&lt;/P&gt;&lt;P&gt;Also can someone tell me how from python to change the value of the self.file_path on frontend ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 15:52:57 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/397823#M824</guid>
      <dc:creator>WarGot</dc:creator>
      <dc:date>2019-04-03T15:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get and update field value on GUI from python backend ?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/397868#M825</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/81266"&gt;@WarGot&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for posting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On your example, you are trying to retrieve "tablesList" value where dataName is "tree".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    &amp;lt;ayx data-ui-props='{type:"ListBox", widgetId:"Tables", heightAuto: true}' data-item-props='{dataName: "&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;tree&lt;/STRONG&gt;&lt;/FONT&gt;"}'&amp;gt;&amp;lt;/ayx&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try with following line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;self.tables = Et.fromstring(str_xml).find('tree').text if 'tree' in str_xml else 'EMPTY'&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PaulN&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 16:37:00 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/397868#M825</guid>
      <dc:creator>PaulN</dc:creator>
      <dc:date>2019-04-03T16:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get and update field value on GUI from python backend ?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/420535#M888</link>
      <description>&lt;P&gt;May be you help me. How to send some data from python to UI ?&lt;/P&gt;&lt;P&gt;For ex.&lt;/P&gt;&lt;P&gt;gui.html&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      &amp;lt;div class='leftCon'&amp;gt;
        &amp;lt;ayx data-ui-props="{type: 'ListBox', showInfoRow: true, searchable: true}" data-item-props="{dataName: 'dataTables'}"&amp;gt;&amp;lt;/ayx&amp;gt;
      &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Python controller:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import AlteryxPythonSDK as Sdk

import xml.etree.ElementTree as Et
import csv
import os
import pyodbc

class AyxPlugin:
    def __init__(self, n_tool_id: int, alteryx_engine: object, output_anchor_mgr: object):
        self.selectedTables = []

    def pi_init(self, str_xml: str):
        # Data from UI
        self.selectedTables = Et.fromstring(str_xml).find('dataTables').text.split(',') if 'dataTables' in str_xml else ''
        &lt;/LI-CODE&gt;&lt;P&gt;How to send array from python and re-render checkbox on frontend ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 13:52:14 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/420535#M888</guid>
      <dc:creator>WarGot</dc:creator>
      <dc:date>2019-05-27T13:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get and update field value on GUI from python backend ?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/420576#M889</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/81266"&gt;@WarGot&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does your use case justify to process data from engine (Python) instead of GUI (JavaScript) directly?&lt;/P&gt;
&lt;P&gt;Although I don't have an example, you could achieve such interactions with a framework like &lt;EM&gt;Flask&lt;/EM&gt; (&lt;A href="http://flask.pocoo.org/" target="_blank"&gt;http://flask.pocoo.org/&lt;/A&gt;) for example. Basically, the GUI would access the engine via a REST API. This is the kind of approach found in&amp;nbsp;&lt;EM&gt;Insights&amp;nbsp;&lt;/EM&gt;tool.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paul Noirel&lt;/P&gt;
&lt;P&gt;Sr Customer Support, Engineer&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 18:06:25 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/420576#M889</guid>
      <dc:creator>PaulN</dc:creator>
      <dc:date>2019-05-27T18:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get and update field value on GUI from python backend ?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/420760#M890</link>
      <description>&lt;P&gt;Ohhh, bad news for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe I can send a ajax request from frontend to python backend method ?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 12:25:40 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/420760#M890</guid>
      <dc:creator>WarGot</dc:creator>
      <dc:date>2019-05-28T12:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get and update field value on GUI from python backend ?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/421662#M896</link>
      <description>&lt;P&gt;Good day @Paul.N&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/7598"&gt;@PaulN&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/81266"&gt;@WarGot&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does your use case justify to process data from engine (Python) instead of GUI (JavaScript) directly?&lt;/P&gt;&lt;P&gt;Although I don't have an example, you could achieve such interactions with a framework like &lt;EM&gt;Flask&lt;/EM&gt; (&lt;A href="http://flask.pocoo.org/" target="_blank" rel="noopener"&gt;http://flask.pocoo.org/&lt;/A&gt;) for example. Basically, the GUI would access the engine via a REST API. This is the kind of approach found in&amp;nbsp;&lt;EM&gt;Insights&amp;nbsp;&lt;/EM&gt;tool.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul Noirel&lt;/P&gt;&lt;P&gt;Sr Customer Support, Engineer&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Good day @Paul.N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My app consists of two layers.&lt;BR /&gt;On the front 3 fields:&lt;BR /&gt;- File Browse to select a database file&lt;BR /&gt;- ListBox 1 to select tables from database&lt;BR /&gt;- ListBox 2 to select fields from table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Backend:&lt;BR /&gt;1. selecting file I Python establish a connection to the database and get the list of tables&lt;BR /&gt;2. I pass the list of tables in listbox 1 and wait for the user's choice&lt;BR /&gt;3. I receive data from listbox1 and send to Python list of tables&lt;BR /&gt;4. From the selected tables, I request a list of fields and pass to the listbox 2&lt;BR /&gt;5. Receive the data from listbox2 and then transmit the data through the workflow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot_2.png" style="width: 188px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/64474iCBBE6DF63575E356/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot_2.png" alt="Screenshot_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 09:58:25 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/421662#M896</guid>
      <dc:creator>WarGot</dc:creator>
      <dc:date>2019-05-30T09:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get and update field value on GUI from python backend ?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/610397#M1302</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/81266"&gt;@WarGot&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also looking for the same thing if it is possible. So, do you have any suggestions now if you have implemented it on your end?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciable!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:01:40 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/How-to-get-and-update-field-value-on-GUI-from-python-backend/m-p/610397#M1302</guid>
      <dc:creator>RuchikaMangla</dc:creator>
      <dc:date>2020-07-27T17:01:40Z</dc:date>
    </item>
  </channel>
</rss>

