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 / PowerApps OneDrive Dat...
Power Apps
Suggested Answer

PowerApps OneDrive Data Not Updating in Real-Time

(1) ShareShare
ReportReport
Posted on by 3
Hello everyone, I'm a newcomer learning about PowerApps.

I am experiencing an issue with data loading speed from OneDrive and would like your advice.

I created an inventory management file using PowerApps. I have a table named SparePart that stores information about the inventory items, and another table called RequestTable where stock-out requests are recorded with a “Pending” status and displayed in the PowerApp as shown in the image.

Here is the issue:

The current stock of item A is 20. I create a request to issue 5 pcs of item A. After approval, the actual Excel file on OneDrive correctly updates the quantity to 15. However, when I use LookUp(SparePart, KeyID = varApproveItem.KeyID).'Current Qty.' to check the quantity, it still shows 20. Only after about one minute, when the data reloads, does it update to 15 pcs.

This causes a problem: if I issue an additional 2 pcs of item A during the time before the data is refreshed, the system still calculates based on 20, resulting in the stock being updated to 18 pcs instead of 13 pcs.

The same issue happens with stock-in transactions. Stock-in does not require approval. For example, if item B has 1 pc in stock and I add 10 pcs, the Excel file correctly shows 11 pcs. However, the app data has not yet refreshed. If I issue 5 pcs of item B during this time, it calculates based on the old data (1 pc), resulting in -4 pcs.

I would like to ask whether there is a way to make the data update instantly.

The images are attached below, and here is the code I am using for the Approve button and the Withdraw button:

Approve button:

Refresh(SparePart);
Patch(
    SparePart,
    LookUp(SparePart, KeyID = varApproveItem.KeyID),
    {'Current Qty.': LookUp(SparePart, KeyID = varApproveItem.KeyID).'Current Qty.' - varApproveItem.'Số lượng'}
);
 
    Patch(
        StockLog,
        Defaults(StockLog),
        {
            LogID: GUID(),
            Ngày: Now(),
            KeyID: varApproveItem.KeyID,
            Name: varApproveItem.Name,
            Model: varApproveItem.Model,
            'Loại giao dịch (Nhập / Xuất)': varApproveItem.'Loại giao dịch (Nhập / Xuất)',
            'Số lượng': varApproveItem.'Số lượng',
            'Đơn vị': varApproveItem.'Đơn vị',
            'Người nhập/xuất': varApproveItem.'Người nộp đơn',
            'Mục đích xuất/nhập kho': varApproveItem.'Mục đích xuất/nhập kho'
        }
    );
 
    Patch(
        RequestTable,
        varApproveItem,
        {
            Status: "Approved",
            'Người duyệt đơn': User().FullName,
            'Ngày phê duyệt': Now()
        }
    );
 
    Notify("Đã phê duyệt và cập nhật kho", NotificationType.Success);
    Back()

Withdraw button:

Set(varQty, Value(TextInput3.Text));
 
If(
    IsBlank(cmbUser.Selected),
    Notify("Vui lòng chọn người Xuất Kho", NotificationType.Error),
 
    IsBlank(TextInput3.Text),
    Notify("Vui lòng nhập số lượng", NotificationType.Error),
 
    varQty <= 0,
    Notify("Số lượng phải lớn hơn 0", NotificationType.Error),
 
    Set(varName, cmbUser.Selected.Name);
 
    Patch(
        RequestTable,
        Defaults(RequestTable),
        {
            RequestID: GUID(),
            'Ngày tạo': Now(),
            KeyID: varPart.KeyID,
            Name: varPart.Name,
            Model: varPart.Model,
            'Loại giao dịch (Nhập / Xuất)': "Xuất kho",
            'Số lượng': varQty,
            'Đơn vị': varPart.'Đơn Vị',
            'Mục đích xuất/nhập kho': cmbMucDich.Selected.Value,
            Status: "Pending",
            'Người nộp đơn': varName
        }
    );
 
    Notify("Đã tạo yêu cầu xuất kho chờ phê duyệt", NotificationType.Success);
 
    Reset(TextInput3);
    Reset(cmbMucDich);
    Reset(cmbUser)
)

 

         

 

 

 

Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,431 Super User 2026 Season 1 on at
    @TS-26020659-0, This is the common issue while using Excel (OneDrive) as a data source for Power Apps, the connector is not transactional and Power Apps will often keep using a cached copy of the table for a while.
     
    So even though the Excel file is updated immediately, your app may still be reading the old value until the connector refreshes its cache normally (20-40 secs).
     
    If you want achieve better transaction enabled inventory app, I would suggest you to use the Microsoft SharePoint List as DataSource (free) . If you are fine with Premium based go for SQL/ Dataverse accordingly.
     
    Short Term Fix
     
    I would suggest you to go for local data (collection). 
    • App on Start - > Create a collection.
    • When you patch the records to Excel -> Update the collection
    • Gallery -> Provides the local collection.
     
    This approach will set for smaller datasets.
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard