cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nebulas
Helper I
Helper I

Apparent corruption in collection of data built from SharePoint list items

Hi team

 

I have an issue with a PowerApp here that has been driving me crazy for weeks now and wondering if anyone has experienced something similar.

 

Issue: A collection built from data within my SharePoint list is showing an incomplete record in row 1. This collection is triggered by the OnVisible property of a screen. The result is that the record displays with incomplete data fields within the App when viewed in Preview Mode in the browser.
NOTE: When I view on Mobile Phone App, or open the App in a Desktop Browser everything appears fine (See screen shots below)

In addition, when I duplicate the code that builds the collection and just modify the name of the collection (E.g. Change collection name from 'colMaterialsSelected' to 'colMaterialsSelectedDuplicate' the new collection shows every record perfectly.

 

Screenshot from Preview Mode (Desktop Browser):

Screen Shot 2021-08-02 at 7.53.34 am.png

 

Screenshot from Live App (Desktop Browser):

Screen Shot 2021-08-02 at 7.55.10 am.png

 

Code Sample:

 

//Set Variable for Selected Gallery Item
Set(
    varSelectedItemMaintenanceRecords,
    galMaintenanceRecords_1.Selected
);

//Rebuild Collections for Materials from SharePoint Values of Selected Gallery Item
Clear(colMaterialsSelected);
ForAll(
    Filter(
        'Maintenance Materials',
        MR_ID = varSelectedItemMaintenanceRecords.ID
    ),
    Collect(
        colMaterialsSelected,
        {
            ID: ThisRecord.ID,
            MR_ID: ThisRecord.MR_ID,
            Quantity: ThisRecord.Quantity,            
            Title: ThisRecord.ItemName,
            ItemName: ThisRecord.ItemName,
            ItemCode: ThisRecord.ItemCode,
            ItemID: ThisRecord.ItemID
        }
    )
);

//Rebuild Collections for Materials from SharePoint Values of Selected Gallery Item DUPLICATE
Clear(colMaterialsSelectedDuplicate);
ForAll(
    Filter(
        'Maintenance Materials',
        MR_ID = varSelectedItemMaintenanceRecords.ID
    ),
    Collect(
        colMaterialsSelectedDuplicate,
        {
            ID: ThisRecord.ID,
            MR_ID: ThisRecord.MR_ID,
            Quantity: ThisRecord.Quantity,            
            Title: ThisRecord.ItemName,
            ItemName: ThisRecord.ItemName,
            ItemCode: ThisRecord.ItemCode,
            ItemID: ThisRecord.ItemID
        }
    )
)

 

 

Has anyone else experienced this or know how to fix?

 

Any help appreciated.

6 REPLIES 6
Nebulas
Helper I
Helper I

Forgot to also add the screenshots from both the original and the new collections:

Screen Shot 2021-08-02 at 8.16.52 am.pngScreen Shot 2021-08-02 at 8.17.04 am.png

poweractivate
Community Champion
Community Champion

@Nebulas 

 

Just to confirm, is there any effect on any live app? Or is it only on the PowerApps Studio editor at make.powerapps.com ?

 

For the issue in the preview mode in make.powerapps.com check if clearing the entire cache and cookies on the browser and signing in again, resolves the issue. Also check if you are using latest version of Chrome, 92.0.4515.107 or Edge 92.0.902.55 - and if possible, try it on both latest versions of Chrome and Edge (clear cache and cookies first as well) and see if issue persists on both browsers after clearing the cache and cookies and signing in again.

Thanks for the fast response. 

There is no impact to the live app either in desktop nor mobile app. Just seems the be an issue with the editor and preview mode. 

The larger impact is trying to develop the next screen where you can edit each item in a gallery. With the false negatives it’s making it troublesome to develop. 

I have tried deleting the cookies and temp internet files and signed out completely etc with no success. 

I will try again tonight and post results here.

 

confirming I am using both latest versions of Chrome and Edge on a mixture of Mac computers all with the same issue.  

Is there any other code that affects this Collection? For example, a code which gets or set the "first item" in

particular?

 

It could be worth also checking the SharePoint list and seeing if there are empty records, although it might be the case that it isn't. Just in case, and if it is possible, a screenshot of how it looks in SharePoint, particularly the row "MR-MAT_FERT"

 

I did not see the screenshots first - now looking at them, notice the "MR-MAT-FERT" is a duplicate ItemID. Check if this might be causing the issue. If it is, there is possibility that eventually the live app will have a problem too. See if this might be related to the issue as well as checking the SharePoint List as well in case.

Hi Again

 

I have tested this process again by logging out, deleting all temp internet files and cookies, closing browser, signing back in and running the app.

 

Same issue: Live app appears normal in the browser, but the preview app, and when I view the collection shows incomplete first record. 

In terms of code that references this collection, I have the following:

 

App > OnStart

//Build colMaterialRecords collection from 'Maintenance Materials' SharePoint columns 
ClearCollect(
    colMaterialsSelected,
    ShowColumns(Table(Defaults('Maintenance Materials')),
    "ID",
    "Title", 
    "Quantity",   
    "MR_ID",
    "ItemName",
    "ItemCode",
    "ItemID"
    )
);

 

Screen >  scrDetails > OnVisible (Screen in original post with the issue and code sample)

//Rebuild Collections for Materials from SharePoint Values of Selected Gallery Item
Clear(colMaterialsSelected);
ForAll(
    Filter(
        'Maintenance Materials',
        MR_ID = varSelectedItemMaintenanceRecords.ID
    ),
    Collect(
        colMaterialsSelected,
        {
            ID: ThisRecord.ID,
            MR_ID: ThisRecord.MR_ID,
            Quantity: ThisRecord.Quantity,            
            Title: ThisRecord.ItemName,
            ItemName: ThisRecord.ItemName,
            ItemCode: ThisRecord.ItemCode,
            ItemID: ThisRecord.ItemID
        }
    )
);

 

Screen > scrMaterials > OnVisible (This is the edit screen that has a gallery to add/update materials)

NOTE: Gets stranger on loading of this screen with first two records showing as incomplete.

Set(varButtonPlaceholder, "ButtonPlaceholder");
Remove(colMaterialsSelected, Filter(colMaterialsSelected,Title = varButtonPlaceholder));
Collect(colMaterialsSelected,{Title: varButtonPlaceholder})

 

See screenshot from SharePoint list below:

Screen Shot 2021-08-02 at 7.14.09 pm.png

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,144)