Hi Team,
I have tried the below code to fetch the group info. Which was successful. But I couldn't able to fetch the contents of the Group.
val portalQueryParameters =
PortalQueryParameters(query = getString(R.string.group_id), limit = 20 )
val groups = portal.findGroups(portalQueryParameters)
I can fetch the group info such as Title which is all good. but I tried to below codes to fetch the item of a particular group based on Id.
val groupId = groups.getOrNull()?.results?.get(0)?.id
val portalGroupContentSearchParameters = PortalGroupContentSearchParameters.query(query = groupId ?: "")
val items = groups.getOrNull()?.results?.get(0)?.findItems(portalGroupContentSearchParameters)
Is that something I am missing. result is success but the item count is 0. But I can view the content items from a ArcGIS web login. I can see 2 items.
I also tried the below code snippet. Items are 0.
val portalQueryParameters =
PortalQueryParameters(query = getString(R.string.group_id), limit = 20 )
val items = portal.findItems(portalQueryParameters)
Is that something related to user access to group items?
Need your help in understanding the flow.
Thanks
Solved! Go to Solution.
Hi ArcGIS,
I am able to fetch all the items in the group passing empty string in PortalGroupContentSearchParameters.
Thanks for your support. refer below code snippet if anyone needs to know.
val portalGroupContentSearchParameters = PortalGroupContentSearchParameters.query("")
val items = groupinfo?.results?.get(0)?.findItems(portalGroupContentSearchParameters)
Hi ArcGIS,
I am able to fetch all the items in the group passing empty string in PortalGroupContentSearchParameters.
Thanks for your support. refer below code snippet if anyone needs to know.
val portalGroupContentSearchParameters = PortalGroupContentSearchParameters.query("")
val items = groupinfo?.results?.get(0)?.findItems(portalGroupContentSearchParameters)
Hello,
I am glad you found a workaround. To query specifically for your group items, you can use
val groupId: String = ...
val portalGroupContentSearchParameters = PortalGroupContentSearchParameters.query("id:$groupId")
There is documentation on the query syntax here