Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

SharePoint Get Items Filter Query Problem

(0) ShareShare
ReportReport
Posted on by 25

Hi - I am working on a flow for my company where changes in a sharepoint folder will get tracked in a sharepoint list. E.g. someone updates the status of a file, the item then gets updated on the sharepoint list as well. To identify the correct item on the sharepoint list, there is a unique ID being created for each item of Client Name_Year End_Type of Work_Type of Document. I am using the "get items" step to filter based on the unique ID, then later using a condition to check if the length of the get items step is = 0. If it is equal to 0, it gets added to the list, if it is not, it gets updated. 

 

I am still in the test phase and have been deleting files and re-adding them to test things out. Now when I run the flow, the get items is showing that a value exists even though the sharepoint list is empty (I deleted the recycle bin as well). So when it gets to the condition for length(get items) <> 0, it tries to update the item, but can't find it. I cannot figure out why it is continuing to think there is an item there that does not exist. There is even a link to it that I can only access from the output of the flow, I can't find the sharepoint list item anywhere else. 

 

Any help would be really appreciated because if I can't figure out how to update per the unique ID, my whole flow will be useless. Thank you!

  • quaglius Profile Picture
    quaglius 16 on at
    Re: SharePoint Get Items Filter Query Problem

    Some things I did some time ago that might help this to get solved: 

    1. Set index to that field in the list.

    2. Trigger a manual indexing from the advanced setting in the list.

     

    Hope this helps!

  • quaglius Profile Picture
    quaglius 16 on at
    Re: SharePoint Get Items Filter Query Problem

    I got this working, same issue with a 35K+ list. Solved by setting NO to "Get Nested Items" in the Get Items action. Others things I did that might or might not help this to get solved: 

    1. Set index to the field in the list.

    2. Trigger a manul indexing from the advanced setting in the list.

     

    Hope this helps!

  • emcaleer Profile Picture
    emcaleer 25 on at
    Re: SharePoint Get Items Filter Query Problem

    Right, but it is not filtering a calculated column, it is filtering the SharePoint List column, which is just a text column. The calculated column is in the SharePoint folder. For each item, if it is new, it adds a new item to the SharePoint list, where it takes the UniqueID from the SharePoint folder and spits it into the List's column. 

  • Shuvam-rpa Profile Picture
    Shuvam-rpa 889 on at
    Re: SharePoint Get Items Filter Query Problem

    @emcaleer As i know odata not support to filter the calculated column

     

  • emcaleer Profile Picture
    emcaleer 25 on at
    Re: SharePoint Get Items Filter Query Problem

    yes within the sharepoint folder, but then at the end of the flow, if it is a new item, it spits it out as a value into the sharepoint list's column. the unique id column in the sharepoint list is just multiple lines of text. it is pulling it in correctly in the sharepoint list, it is just not recognizing that something already exists with the same ID. the first 2 listed here are with one status, and the second two listed have a different status. i wanted the first two to update with the new status, not to create two new items on the sharepoint list: 

    emcaleer_0-1661273338503.png

     

  • Shuvam-rpa Profile Picture
    Shuvam-rpa 889 on at
    Re: SharePoint Get Items Filter Query Problem

    @emcaleer the unique id column is a calculated column ??

  • emcaleer Profile Picture
    emcaleer 25 on at
    Re: SharePoint Get Items Filter Query Problem

    The flow is checking for new items created/modified within a sharepoint folder. Each item/file should have a unique ID that is a calculated value in sharepoint column. The flow then checks to see if there are any items on the sharepoint list with this unique id: 

    emcaleer_2-1661272520655.png

     

    The compose outputs is just taking the existing unique ID, you can ignore that it's from a compose, that is for one scenario that is not relevant here.

     

    The last section of the flow happens after some other changes/approvals are sent out. The goal is that after certain things happen, the flow will always go back and update the item on the SharePoint list for the current status. If the item doesn't exist, it should create a new item. However it just keeps creating new items, it can't seem to recognize that the uniqueID already exists.

     

    length(outputs('Get_items_on_SP_List_per_Unique_ID')?['body/value'])

     

    emcaleer_0-1661269838352.png

    emcaleer_1-1661269852080.png

     

     

    Any help is much appreciated. Thank you!

  • Shuvam-rpa Profile Picture
    Shuvam-rpa 889 on at
    Re: SharePoint Get Items Filter Query Problem

    @emcaleer share your flow screenshot in edit mode

  • emcaleer Profile Picture
    emcaleer 25 on at
    Re: SharePoint Get Items Filter Query Problem

    Hi - the unique ID is one I am generating, it is a calculated column in the SharePoint folder, then it gets entered into the SharePoint List tracker as part of the flow if it cannot find anything with that unique ID. The problem is, it should be able to find items with that unique ID, it just can't seem to, so I am ending up with a lot of duplicates. 

  • Shuvam-rpa Profile Picture
    Shuvam-rpa 889 on at
    Re: SharePoint Get Items Filter Query Problem

    @emcaleer is the unique id you are referring  is a ID column of the sharepoint List??

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,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard