Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Error when trying to retrieve data from the network - (Title = ThisRecord.Title)

(2) ShareShare
ReportReport
Posted on by 136
Hi there,
 
I have some items in a SharePoint List which tracks my Active Bookings, as well as a Log which tracks all bookings both past and present.
 
These items are then shown in a PowerApps gallery in which a checkbox allows users to add each item to a collection, colSelectedShelves.
 
There is then a button which should do the following, based on the code I have written:
 
1. Update the field which matches the item in the Log list, by populating the Shelved Date and Shelved By columns.
The First(Sort( is to ensure that the item in the Log is the most recent based on the Booked Date, and it doesn't accidentally update one of the older iterations of the item being booked out.
2. It should then remove the fields from the Active Bookings list as they are no longer booked out.
 
I am, however, facing the error Error when trying to retrieve data from the network: Fetching items failed.  Possible invalid string in filter query.
 
Both the Title and Room columns are Single Lines of Text. Please see my code below:
ForAll(
    colSelectedShelves,
    Patch(
        First(
            Sort(
                Filter(
                    'AV Asset Bookings Log',
                    Title = ThisRecord.Title && Room = ThisRecord.Room
                ),
                'Booked Date',
                SortOrder.Descending
            )
        ),
        {
            'Shelved Date': Now(),
            'Shelved By': {
                Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
                DisplayName: "",
                Email: technicianProfile.mail,
                Department: "",
                JobTitle: "",
                Picture: ""
            }
        }
    );
    Remove(
        'AV Asset Bookings Active List',
        LookUp(
            'AV Asset Bookings Active List',
            Title = ThisRecord.Title && Room = ThisRecord.Room
        )
    );
);
Clear(colSelectedShelves);
Refresh('AV Asset Bookings Active List');
Many thanks in advance.
 
  • mmbr1606 Profile Picture
    12,652 Super User 2025 Season 1 on at
    Error when trying to retrieve data from the network - (Title = ThisRecord.Title)
    hey
     
     
    great that it worked with a bit of twisting ;)
     
     
    cheers
  • Verified answer
    aantoniou Profile Picture
    136 on at
    Error when trying to retrieve data from the network - (Title = ThisRecord.Title)
    Thank you SO much! I had to make one small adjustment which was to alias colSelectedShelves as shelf so that it knows to target that specific collection instead of with ThisRecord, it works perfectly now. I'm still not 100% sure as to why it didn't originally work, it would be good to get some further insight. Thanks again!
    ClearCollect(
        colLog,
        'AV Asset Bookings Log'
    );
    ClearCollect(
        colActive,
        'AV Asset Bookings Active List'
    );
    ForAll(
        colSelectedShelves As shelf,
        With(
            {
                currentLogItem: First(
                    SortByColumns(
                        Filter(
                            colLog,
                            Title = shelf.Title && Room = shelf.Room
                        ),
                        "BookedDate",
                        "Descending"
                    )
                ),
                currentActiveItem: LookUp(
                    colActive,
                    Title = shelf.Title && Room = shelf.Room
                )
            },
            Patch(
                'AV Asset Bookings Log',
                currentLogItem,
                {
                    'Shelved Date': Now(),
                    'Shelved By': {
                        Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
                        DisplayName: "",
                        Email: technicianProfile.mail,
                        Department: "",
                        JobTitle: "",
                        Picture: ""
                    }
                }
            );
            Remove(
                'AV Asset Bookings Active List',
                LookUp(
                    'AV Asset Bookings Active List',
                    Title = shelf.Title && Room = shelf.Room
                )
            );
        )
    );
    Clear(colSelectedShelves);
    Refresh('AV Asset Bookings Active List');
    Refresh('AV Asset Bookings Log');
    
  • Verified answer
    mmbr1606 Profile Picture
    12,652 Super User 2025 Season 1 on at
    Error when trying to retrieve data from the network - (Title = ThisRecord.Title)
    hey
     
     
    thanks for trying.
     
    Another suggestion:
     
    ClearCollect(colLog, 'AV Asset Bookings Log');
    ClearCollect(colActive, 'AV Asset Bookings Active List');
    
    ForAll(
        colSelectedShelves,
        With(
            {
                currentLogItem: First(
                    SortByColumns(
                        Filter(
                            colLog,
                            Title = ThisRecord.Title &&
                            Room = ThisRecord.Room
                        ),
                        "Booked Date",
                        Descending
                    )
                ),
                currentActiveItem: LookUp(
                    colActive,
                    Title = ThisRecord.Title &&
                    Room = ThisRecord.Room
                )
            },
            Patch(
                'AV Asset Bookings Log',
                currentLogItem,
                {
                    'Shelved Date': Now(),
                    'Shelved By': {
                        Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
                        DisplayName: "",
                        Email: technicianProfile.mail,
                        Department: "",
                        JobTitle: "",
                        Picture: ""
                    }
                }
            );
            Remove(
                'AV Asset Bookings Active List',
                currentActiveItem
            )
        )
    );
    
    Clear(colSelectedShelves);
    Refresh('AV Asset Bookings Active List');
    Refresh('AV Asset Bookings Log');
    
    If my answer was helpful and it solved your issue please mark it as verified answer. If it helped but did not solve please consider giving me a like :)
  • aantoniou Profile Picture
    136 on at
    Error when trying to retrieve data from the network - (Title = ThisRecord.Title)
    Hi @mmbr1606, thanks for your response. Unfortunately I still get the same error. I originally had this which somewhat worked:
    Title in colSelectedShelves.Title && Room in colSelectedShelves.Room
    but from what I gather, using "in" is not a favoured option here.
  • Suggested answer
    mmbr1606 Profile Picture
    12,652 Super User 2025 Season 1 on at
    Error when trying to retrieve data from the network - (Title = ThisRecord.Title)
    hey
     
     
    can you try this code:
     
    ForAll(
        colSelectedShelves,
        With(
            {
                currentLogItem: First(
                    Sort(
                        Filter(
                            'AV Asset Bookings Log',
                            Title = ThisRecord.Title &&
                            Room = ThisRecord.Room
                        ),
                        'Booked Date',
                        Descending
                    )
                ),
                currentActiveItem: LookUp(
                    'AV Asset Bookings Active List',
                    Title = ThisRecord.Title &&
                    Room = ThisRecord.Room
                )
            },
            Collect(
                colToPatch,
                Patch(
                    currentLogItem,
                    {
                        'Shelved Date': Now(),
                        'Shelved By': {
                            Claims: "i:0#.f|membership|" & technicianProfile.userPrincipalName,
                            DisplayName: "",
                            Email: technicianProfile.mail,
                            Department: "",
                            JobTitle: "",
                            Picture: ""
                        }
                    }
                )
            );
            Remove(
                'AV Asset Bookings Active List',
                currentActiveItem
            )
        )
    );
    Clear(colSelectedShelves);
    Refresh('AV Asset Bookings Active List');
    
    If my answer was helpful and it solved your issue please mark it as verified answer. If it helped but did not solve please consider giving me a like :)

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >