web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch Function - Inval...
Power Apps
Unanswered

Patch Function - Invalid Query String in LookUp

(0) ShareShare
ReportReport
Posted on by 21

My formulas in the screen's OnVisible property look like this: 

ClearCollect(myCollection, Filter(mySharePointList, mySharePointColumn = variable));

ForAll(myCollection, Patch(mySharePointList, LookUp(mySharePointList, ID = ThisRecord.ID), {OTHER_COLUMN: otherVariable}));

 

But when I navigate to that screen, I get the following error: 

Error when trying to retrieve data from the network: Fetching items failed. Possible invalid string in filter query.
Status code is 400.
 
I had to set it up this way because it won't allow patching to the same data source that is in the ForAll. Is it not possible to use a collection as the first argument in a ForAll loop?
Categories:
I have the same question (1)
  • Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at

    Hi

    Yes you can use a collection in ForAll

     

    When is variable set? And when is ThisRecord (gallery selected or edit form etc)??

     

    My concern is that these aren't set yet so it fails.

     

    I would recommend using Monitor to catch the errors and get the extended information.

    Step 1. Close your App (stop it running)
    Step 2. Click the Stethoscope in the Top Right
    Step 3. On the bottom click Open Monitor
    Step 4. Once Monitor is running go back and run your app
    Step 5. Cause your issue to happen
    Step 6. Close the app
    Step 7. Go to the Monitor and Filter (top right) based on Error, or key word. Find the error line and look at the information Monitor has for why it failed.

    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • bspang Profile Picture
    21 on at

    Unfortunately, that error message was gathered in a monitoring session. That was all the detail that was given from that.

  • Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at

    Were you able to pull the actual query string though in the Request Tab of Monitor for that Error?

     

    So that you can validate the parameters in it to see which one might be wrong?

  • TB-12030945-0 Profile Picture
    2 on at
    I was also more than desperate with this error message. Even though the question was asked a long time ago, here is my solution:
    WIthin ForAll replace all 'ThisRecord.XYZ' by 'collection[@XYZ]
     
    Example:
    ForAll(myCollection, Patch(mySharePointList, LookUp(mySharePointList, ID = myCollection[@ID]), {OTHER_COLUMN: otherVariable}));

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard