<?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 Issue querying users items - Specfically Folders in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-querying-users-items-specfically-folders/m-p/1255370#M85141</link>
    <description>&lt;P&gt;Good Day&lt;BR /&gt;&lt;BR /&gt;I have the following function which is running query by username to get the folders that a user has access to.&amp;nbsp; This function worked a couple of weeks ago, and would return me the list, and now it's running nothing.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;private getArcGISFolders(): Promise&amp;lt;ArcGISItem[] | Error&amp;gt;{
	return new Promise((r, j) =&amp;gt; {
		const query = new PortalQueryParams({
			query: `username: ${this._portal.user.username}`,
		});

		this._portal.queryUsers(query).then((queryResults) =&amp;gt; {
			this._folders = [];
			if (!Array.isArray(queryResults.results)) {
				j();
			} else {
				try {
					queryResults.results?.forEach((folder) =&amp;gt; {

						console.log('Folder');
						console.log(folder);

						this._folders.push({
							id: folder.id,
							title: folder.title
						})
					})
				} catch(error) {
					j(error);
				}
			}
			r(this._folders);
		}).catch((error) =&amp;gt; {
			console.log('Query User - Error');
			console.log(error);
			j(error);
		})
	})
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Is this the right way to query for folders?&amp;nbsp;&lt;BR /&gt;2. What would prevent this query from returning the folders&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 16:04:16 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2023-02-06T16:04:16Z</dc:date>
    <item>
      <title>Issue querying users items - Specfically Folders</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-querying-users-items-specfically-folders/m-p/1255370#M85141</link>
      <description>&lt;P&gt;Good Day&lt;BR /&gt;&lt;BR /&gt;I have the following function which is running query by username to get the folders that a user has access to.&amp;nbsp; This function worked a couple of weeks ago, and would return me the list, and now it's running nothing.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;private getArcGISFolders(): Promise&amp;lt;ArcGISItem[] | Error&amp;gt;{
	return new Promise((r, j) =&amp;gt; {
		const query = new PortalQueryParams({
			query: `username: ${this._portal.user.username}`,
		});

		this._portal.queryUsers(query).then((queryResults) =&amp;gt; {
			this._folders = [];
			if (!Array.isArray(queryResults.results)) {
				j();
			} else {
				try {
					queryResults.results?.forEach((folder) =&amp;gt; {

						console.log('Folder');
						console.log(folder);

						this._folders.push({
							id: folder.id,
							title: folder.title
						})
					})
				} catch(error) {
					j(error);
				}
			}
			r(this._folders);
		}).catch((error) =&amp;gt; {
			console.log('Query User - Error');
			console.log(error);
			j(error);
		})
	})
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Is this the right way to query for folders?&amp;nbsp;&lt;BR /&gt;2. What would prevent this query from returning the folders&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 16:04:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-querying-users-items-specfically-folders/m-p/1255370#M85141</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2023-02-06T16:04:16Z</dc:date>
    </item>
  </channel>
</rss>

