Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Collect Data to SPO List works in Preview Mode but not in Published App

(0) ShareShare
ReportReport
Posted on by 29
Dear Community,
I built an App which prepares some data to be saved in Sharepoint Lists later on.
 
There are 3 temporarily containers called mainData, WorkData and materialData. I've got corresponding SPO lists.
All the composing of data in my App works fine.
In the end I've got a button that calls a component with an output property. The component has access to the app scope.
 
clientAppActionsSiteConfirmation.saveReportToSPO();;
 
My output property has actions like the following code. The component has access to the app scope.
Up to June13th this all worked well.
My code doesn't throw any error.
Unfortunately it only works in preview mode of Power Apps Studio. After publishing my app the code won't save workdata to the target SPO list.
The reportCoreData and the material data work well.
 
Any suggestions?
 
 
// patches Data to main data list

Patch(
   reportCoreData;
   Defaults(reportCoreData);
   {
       some main Data
   }
);;

 
// saves workdata
Collect(
    reportWorkData;
    Filter(
        RenameColumns(
            workHandle;
            employee;
            employeeGUID;
            reportCoreData;
            reportCoreDataGUID
        );
        dateMinutes > 0 Or weekMinutes > 0
    )
);;
 
// saves materialdata
Collect(reportMaterialData;
  Filter(
    RenameColumns(
      ShowColumns(
        materialHandle;
        Titel;reportCoreDataGUID;itemGUID;itemQuantity
        );
      Titel;Title
      );
    itemQuantity>0
    )
  );;
 
Categories:
  • SvenThorbergLL Profile Picture
    29 on at
    Collect Data to SPO List works in Preview Mode but not in Published App
    Dear Michael,
    thank you for your detailed answer.
     
    To firstly answer the most important question: Yes, before June 13th it all worked well in published mode.
    I've got my last data rows in the affected SPO list on that date.
     
    I will work through your other notes as well.
  • Suggested answer
    Michael E. Gernaey Profile Picture
    44,960 Super User 2025 Season 2 on at
    Collect Data to SPO List works in Preview Mode but not in Published App
     
    A little confused. You said it worked fine until the 13th? but I cannot tell if that means in published mode and preview mode or just preview mode.
     
    Has it ever worked in published mode?
     
    So a couple of things. (feel free to do 1 then 2 then 5) I just typed them up not specifically in order of ease.
     
    0. If you built it in Dev, then exported the SharePoint lists to build them in Prod/Test Published, did you use environment variables? Did you set them all correctly? Did you verify that the names of the columns are the same (if you did a manual create or import from Excel which would rename them).
     
    1. Validate that the Lists/Tables have the same permissions, its super important to quadruple check every detail.
     
    2. If you have conditional data (collections, variables etc, we need to make sure there is data in those at runtime in published mode). The best way to do that, is to place Trace statements in your code. There is another way, but I'll explain that after.
     
    Change your patch to be something like this
    Set(newRowId, PatchStatement);
     
    Before your Patch and after your Patch Add
    Trace("Patching List/Table Name with Values - " & Value1 & "-" & Value2 & etc);
     
    Trace("Patched List/Table and newRowId = " & Text(newRowId)); <== depends if its SharePoint and you get the ID or the GUID from Dataverse if you need to convert it
     
    3. Add error handling around your patch statements, to capture any errors that happen and/or to also include trace statements here instead of popping them up to the user.
     
    4. Add code into the OnError property of the App itself. This will allow you to capture any Global errors no matter where they are if you didn't locally handle them, or if you did and want to throw them further up for logging. 
     
    5. Validate what it is doing using Monitor, so that we can rule out any errors. Please do the following if #1 doesn't come up with anything
    A) Publish your app just to be safe
    B) Go to the Apps Page
    C) Find your App and Click ... at the end of the line
    D) Select Details <== Live Monitor
    E) Let it load up.
    F) Click Play Published App
    G) go to App Tab, Cause the situation to happen
    H) Go back to Live Monitor, in the Top Right Corner, for Filter, put Error
    If you see errors do the following
    --make sure the Properties Window (its vertical on the right-hand side and by default closed) click it open
    --click the errors until you find the one that has 4 Tabs
    --click on the Response tab
    --Click on Body and Header and expand them
    --See what the error says, it could be permissions, or naming, or other
    --Resolve the problem
     
    I) If no errors at all, and you added Trace statements, then clear Error and add Trace as your Filter. 
    --Look at the values and validate that the data was actually there and not blank
    --validate that you received a GUID/ID back
    --If you added error handling, validate that it didn't kick in.
     
    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
    Thank you!
    Sincerely, Michael Gernaey

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2