<?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: Inbox query syntax with username variable in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857062#M25002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌ &lt;A href="https://community.esri.com/migrated-users/283902"&gt;Philip Wilson&lt;/A&gt;‌, &lt;A href="https://community.esri.com/migrated-users/3966"&gt;Ismael Chivite&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to follow up on the question posted above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the same troubles to use the Where statement as mentioned above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;userlist LIKE '%' + ${username} + '%'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;A static query works as designed but the concatenation of the % and variable values does not work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Below is the logfile of the Survey123 App. The survey is able to use the ${username} variable but is not resolving the where query correctly. I was not able to produce a correct query when using a variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Any Ideas or thoughts?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;[AppStudio@11205 category="SurveyFolderPageInbox" function="replaceWhereVars" filename="SurveyFolderPageInbox.qml" line="813"] SurveyFolderPageInbox: replaceWhereVars where: &lt;STRONG&gt;"userlist&amp;nbsp;LIKE '%' +${username} +'%'"&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;15&amp;gt;1 2020-11-02T16:20:56Z coben ArcGISSurvey123 18392 - [AppStudio@11205 category="SurveyFolderPageInbox" function="buildQuery" filename="SurveyFolderPageInbox.qml" line="582"] SurveyFolderPageInbox: applySpatialFilter: false isMapActive: false map: null&lt;BR /&gt;&amp;lt;15&amp;gt;1 2020-11-02T16:20:56Z coben ArcGISSurvey123 18392 - [AppStudio@11205 category="SurveyFolderPageInbox" function="queryFeatures" filename="SurveyFolderPageInbox.qml" line="493"] SurveyFolderPageInbox: query body: {&lt;BR /&gt; "outFields": "OBJECTID,GlobalID,EditDate,Editor,CreationDate,Creator,MPL_Nr,Prod_Team_mpl",&lt;BR /&gt; "where": &lt;STRONG&gt;"userlist&amp;nbsp;LIKE '%' +'&lt;SPAN style="color: #000000;"&gt;resolvedUSERNAME&lt;/SPAN&gt;' +'%'"&lt;/STRONG&gt;,&lt;BR /&gt; "outSR": 4326,&lt;BR /&gt; "returnGeometry": true,&lt;BR /&gt; "returnZ": true,&lt;BR /&gt; "returnM": false&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Survey123 Connect: 3.11.123&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Survey123 App Windows: 3.11.64 (and current iPhone and Android Version)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Hosted Feature Service in ArcGIS Online.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks a lot and all the best&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Chris&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 16:28:14 GMT</pubDate>
    <dc:creator>ChristopherHaupt1</dc:creator>
    <dc:date>2020-11-02T16:28:14Z</dc:date>
    <item>
      <title>Inbox query syntax with username variable</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857057#M24997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Was there a change made that affected the use of ${username} in the inbox query statement?&amp;nbsp; I am exactly copying the syntax as it is displayed on the Survey123 help page:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Creator LIKE '%' + ${username} + '%'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The only difference is that instead of "creator", I am using 'crew_usernames' which is one of my fields.&amp;nbsp; So its actually:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;crew_usernames LIKE '%' + ${username} + '%'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;If I input my actual username instead of ${username} the expression works as expected.&amp;nbsp; So that looks like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;crew_usernames LIKE '%Andrew.MoskaLee@dec.ny.gov_nysdec%'&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;So there is definitely a problem with the syntax surrounding the username variable.&amp;nbsp; Does anyone know the correct syntax?&amp;nbsp; Or have any other ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;-Andy&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2020 19:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857057#M24997</guid>
      <dc:creator>AndrewMoskaLee</dc:creator>
      <dc:date>2020-04-14T19:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox query syntax with username variable</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857058#M24998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your syntax looks correct. &amp;nbsp;Can you verify that the username of the person is one present in the crew_assignments values?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2020 21:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857058#M24998</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2020-04-21T21:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox query syntax with username variable</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857059#M24999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes the username is definitely correct.&amp;nbsp; If I use crew_usernames=${username} it works as expected.&amp;nbsp; I just have to make sure that there is only one username in the crew_usernames field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2020 23:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857059#M24999</guid>
      <dc:creator>AndrewMoskaLee</dc:creator>
      <dc:date>2020-04-21T23:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox query syntax with username variable</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857060#M25000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Survey123 v3.7.57&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same question. I added username to a survey, re-published and submitted a survey. I queried the table through the service and&amp;nbsp;turned on all fields. The value for username is blank for the survey I submitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="username is blank" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/489849_username_is_blank.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2020 04:42:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857060#M25000</guid>
      <dc:creator>MikeOnzay</dc:creator>
      <dc:date>2020-04-24T04:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox query syntax with username variable</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857061#M25001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi i try to use this example and doenst work. what i do is this:&lt;/P&gt;&lt;P&gt;${username} like '%'||entidad||'%' in the query of the inbox.&lt;/P&gt;&lt;P&gt;for example : have company XY, and i want the users of XY company to see his submitions.&lt;/P&gt;&lt;P&gt;the usernames was created with XY_user1, XY_user2 ect. the in entidad i put XY.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the username are the email then fill entidad using the subst function to extract and fill with the&amp;nbsp;letters after the @ of the email.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2020 12:18:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857061#M25001</guid>
      <dc:creator>josevaldes1</dc:creator>
      <dc:date>2020-04-24T12:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox query syntax with username variable</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857062#M25002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌ &lt;A href="https://community.esri.com/migrated-users/283902"&gt;Philip Wilson&lt;/A&gt;‌, &lt;A href="https://community.esri.com/migrated-users/3966"&gt;Ismael Chivite&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to follow up on the question posted above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the same troubles to use the Where statement as mentioned above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;userlist LIKE '%' + ${username} + '%'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;A static query works as designed but the concatenation of the % and variable values does not work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Below is the logfile of the Survey123 App. The survey is able to use the ${username} variable but is not resolving the where query correctly. I was not able to produce a correct query when using a variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Any Ideas or thoughts?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;[AppStudio@11205 category="SurveyFolderPageInbox" function="replaceWhereVars" filename="SurveyFolderPageInbox.qml" line="813"] SurveyFolderPageInbox: replaceWhereVars where: &lt;STRONG&gt;"userlist&amp;nbsp;LIKE '%' +${username} +'%'"&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;15&amp;gt;1 2020-11-02T16:20:56Z coben ArcGISSurvey123 18392 - [AppStudio@11205 category="SurveyFolderPageInbox" function="buildQuery" filename="SurveyFolderPageInbox.qml" line="582"] SurveyFolderPageInbox: applySpatialFilter: false isMapActive: false map: null&lt;BR /&gt;&amp;lt;15&amp;gt;1 2020-11-02T16:20:56Z coben ArcGISSurvey123 18392 - [AppStudio@11205 category="SurveyFolderPageInbox" function="queryFeatures" filename="SurveyFolderPageInbox.qml" line="493"] SurveyFolderPageInbox: query body: {&lt;BR /&gt; "outFields": "OBJECTID,GlobalID,EditDate,Editor,CreationDate,Creator,MPL_Nr,Prod_Team_mpl",&lt;BR /&gt; "where": &lt;STRONG&gt;"userlist&amp;nbsp;LIKE '%' +'&lt;SPAN style="color: #000000;"&gt;resolvedUSERNAME&lt;/SPAN&gt;' +'%'"&lt;/STRONG&gt;,&lt;BR /&gt; "outSR": 4326,&lt;BR /&gt; "returnGeometry": true,&lt;BR /&gt; "returnZ": true,&lt;BR /&gt; "returnM": false&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Survey123 Connect: 3.11.123&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Survey123 App Windows: 3.11.64 (and current iPhone and Android Version)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Hosted Feature Service in ArcGIS Online.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks a lot and all the best&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Chris&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 16:28:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857062#M25002</guid>
      <dc:creator>ChristopherHaupt1</dc:creator>
      <dc:date>2020-11-02T16:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inbox query syntax with username variable</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857063#M25003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main issue is the use of '+' for string concatenation - that is not allowed in standardized sql feature services. &amp;nbsp;Per&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm" title="https://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm"&gt;Standardized SQL functions in ArcGIS Online—ArcGIS Online Help | Documentation&lt;/A&gt;&amp;nbsp;, one of the following options can be used:&lt;/P&gt;&lt;P&gt;- CONCAT - when you want to join strings to gether&lt;/P&gt;&lt;P&gt;- POSITION - when you want to determine if a string occurs in a field. &amp;nbsp;This is the one you likely want for your scenario (given a field of the name user list, I am guessing it contains 0+ usernames a record could be assigned to).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 17:21:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-syntax-with-username-variable/m-p/857063#M25003</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2020-11-02T17:21:44Z</dc:date>
    </item>
  </channel>
</rss>

