<?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: Querying the portal via queryUser to get folders in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-the-portal-via-queryuser-to-get-folders/m-p/1258212#M80255</link>
    <description>&lt;P&gt;I ended up doing a manual rest call, but why would the cost work without that call and then suddenly break?&amp;nbsp; Now it's working fine, so I don't want to make any more changes to it.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2023 21:08:30 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2023-02-14T21:08:30Z</dc:date>
    <item>
      <title>Querying the portal via queryUser to get folders</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-the-portal-via-queryuser-to-get-folders/m-p/1255888#M80185</link>
      <description>&lt;P&gt;Good Day&lt;BR /&gt;&lt;BR /&gt;I posted a similar question under the ArcGIS REST JS section.&amp;nbsp;&amp;nbsp; I'm running a query by username to try and fetch the folders that are under a user account, where is the function:&lt;BR /&gt;&lt;BR /&gt;&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;A couple of weeks ago this function was working fine, and I was getting the folders that a user had under their ArcGIS Account, and now I'm not.&amp;nbsp; I noticed in the response that "access" is set to "public", which I think is what is causing the problem.&lt;BR /&gt;&lt;BR /&gt;1. Is there a way to properly modify the access of the queryUser function?&lt;BR /&gt;2. Is this the right way to query for folders from ArcGIS?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:39:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-the-portal-via-queryuser-to-get-folders/m-p/1255888#M80185</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2023-02-07T20:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the portal via queryUser to get folders</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-the-portal-via-queryuser-to-get-folders/m-p/1256353#M80200</link>
      <description>&lt;P&gt;HI there,&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;Your code looks similar to the code snippet found here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryUsers" target="_self"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryUsers&lt;/A&gt;. &amp;nbsp; But the code snippet calls &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchFolders" target="_self"&gt;fetchFolders&lt;/A&gt;. Can you update your code to call fetchFolders as shown in the code snippet?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 23:32:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-the-portal-via-queryuser-to-get-folders/m-p/1256353#M80200</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-02-08T23:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Querying the portal via queryUser to get folders</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-the-portal-via-queryuser-to-get-folders/m-p/1258212#M80255</link>
      <description>&lt;P&gt;I ended up doing a manual rest call, but why would the cost work without that call and then suddenly break?&amp;nbsp; Now it's working fine, so I don't want to make any more changes to it.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 21:08:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-the-portal-via-queryuser-to-get-folders/m-p/1258212#M80255</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2023-02-14T21:08:30Z</dc:date>
    </item>
  </channel>
</rss>

