Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

Sharepoint - Get Items - $Select ?

(0) ShareShare
ReportReport
Posted on by 18

Greetings!

 

I'm trying to create a flow that takes posts created in the last week in a Sharepoint blog "list" and mails out the titles and links via e-mail. When I attempt to "Get Items" from the blog list I get this error on the step:

 

Body
{
  "status"400,
  "message""The query to field 'NumComments/PostTitle' is not valid.\r\nclientRequestId: 0247d8af-459f-4ec9-9c8a-652e18010eba",
  "source""https://REDACTED.sharepoint.com/sites/swarm/news//_api/SP.APIHubConnector.GetListItems(listName='Posts',queryOptions=@q)?@q='%2524orderby%3dCreated%2520desc%26%2524top%3d10'",
  "errors": [
    "-1",
    "Microsoft.SharePoint.SPException"
  ]
}
 
Is there a workaround for this? Is there a way to pass a $select portion into the "Get Items" step? I don't need the field Flow seems to be choking on. 
 
Thank you all for your help!
 
 
 
Categories:
  • DennisWOlson Profile Picture
    DennisWOlson 18 on at
    Re: Sharepoint - Get Items - $Select ?

    Thanks for your reply Mabel! Sorry it took so long to reply. 

     

    Here is the "Post" content type. Below that is the json definition of the Flow, and below that, the json of the error message.

    Post-List-Settings.png

    {
     "$connections": {
     "value": {
     "sharepointonline": {
     "connectionId": "/subscriptions/3200b703-8ae2-4bd4-9c66-dcd3bf335cd2/resourceGroups/Redacted-Tasks/providers/Microsoft.Web/connections/sharepointonline",
     "connectionName": "sharepointonline",
     "id": "/subscriptions/3200b703-8ae2-4bd4-9c66-dcd3bf335cd2/providers/Microsoft.Web/locations/northcentralus/managedApis/sharepointonline"
     }
     }
     },
     "definition": {
     "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
     "actions": {
     "Create_HTML_table": {
     "inputs": {
     "columns": [
     {
     "value": "@item()['dynamicProperties']"
     },
     {
     "value": "@item()['ItemInternalId']"
     }
     ],
     "format": "HTML",
     "from": "@body('Get_items')?['value']"
     },
     "runAfter": {
     "Get_items": [
     "Succeeded"
     ]
     },
     "type": "Table"
     },
     "Get_items": {
     "inputs": {
     "host": {
     "connection": {
     "name": "@parameters('$connections')['sharepointonline']['connectionId']"
     }
     },
     "method": "get",
     "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://redacted.sharepoint.com/sites/redacted/news/'))}/tables/@{encodeURIComponent(encodeURIComponent('Posts'))}/items"
     },
     "runAfter": {},
     "type": "ApiConnection"
     }
     },
     "contentVersion": "1.0.0.0",
     "outputs": {},
     "parameters": {
     "$connections": {
     "defaultValue": {},
     "type": "Object"
     }
     },
     "triggers": {
     "Recurrence": {
     "recurrence": {
     "frequency": "Minute",
     "interval": 15
     },
     "type": "Recurrence"
     }
     }
     }
    }
    {
     "status": 400,
     "message": "The query to field 'NumComments/PostTitle' is not valid.\r\nclientRequestId: 026ba1a4-145e-40f3-8527-59ac4b5ad5bb",
     "source": "https://redacted.sharepoint.com/sites/redacted/news//_api/SP.APIHubConnector.GetListItems(listName='Posts',queryOptions=@q)?@q=''",
     "errors": [
     "-1",
     "Microsoft.SharePoint.SPException"
     ]
    }

     

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    Re: Sharepoint - Get Items - $Select ?

    Hi DennisWOlson,

     

    I am not sure with the “Sharepoint blog list” you mentioned. Is it a custom list in SharePoint? Could you share more info on it?

     

    Please share a screenshot of your flow configuration. Do you have any special settings on the action “Get items”?

     

    Currently, filter query is supported by Flow, but seems that select query has not been supported yet. Please take this doc for more details:
    https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-rest-requests

     

    And you could also add a request at Flow ideas Forum the $select query, I will help collect and report it on my side:
    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    Best regards,
    Mabel Mao

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard

Featured topics