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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / 'Error when trying to ...
Power Apps
Suggested Answer

'Error when trying to retrieve data from the network: Fetching items failed.

(1) ShareShare
ReportReport
Posted on by 2

"I’m building a Power App that allows employees to order promotional items. The app uses two SharePoint lists: one for inventory (Inventory) and another for orders (Orders). Selected items are stored in a collection named colCart.

The app successfully adds items from colCart to the Orders list, but I encounter an error when trying to subtract the Quantity in colCart from Inventory.Quantity_Available in the Inventory list. The error message is:

'Error when trying to retrieve data from the network: Fetching items failed. Possible invalid string in filter query.'

Here’s the logic I’m using in the ForAll loop to update Inventory.Quantity_Available:

 
ForAll(
colCart,
Patch(
Inventory,
LookUp(Inventory, ID = ThisRecord.ID),
{ Quantity_Available: LookUp(Inventory, ID = ThisRecord.ID).Quantity_Available - ThisRecord.Quantity }
)
)

The ID column in Inventory and colCart are numeric and match. I can get the code to work if I use a static quantity. What could be causing this error, and how can I correctly update the Quantity_Available column in the Inventory list?"

Categories:
  • Suggested answer
    SaiRT14 Profile Picture
    1,992 Super User 2025 Season 1 on at
     
    The following should fix the issue.
     
    ForAll(
        colCart,
        Patch(
            Inventory,
            LookUp(Inventory, ID = ThisRecord.ID),
            {
                Quantity_Available: Quantity_Available - ThisRecord.Quantity
            }
        )
    )
     
    Thanks.
  • jcbreland Profile Picture
    2 on at
    Thanks for the help but It didn't like second Quantity_Available. Name isn't recognized was the error given.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard