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 App is displ...
Power Apps
Answered

PowerApps App is displaying old values where actual values are Null

(0) ShareShare
ReportReport
Posted on by 894

My Power Apps app is showing old values from a previous record where the current values are NULL.

This is totally unacceptable!

 

In all cases I have set Reset to true.

In all cases I have set Default Data to a formula like:

 

    If(!IsBlank(SelectedItem.ActualQtyDelivered)||!IsEmpty(SelectedItem.ActualQtyDelivered),

        SelectedItem.ActualQtyDelivered,

        "")

 

My record is loaded in the OnVisible action of the screen:

 

    UpdateContext({Tab1:true});
    If(!IsBlank(SelectedItem.thOurRef)||!IsEmpty(SelectedItem.thOurRef),
        ClearCollect(itemCollection,UpdateGoodsIn.Run(SelectedItem.thOurRef, SelectedItem.stCode)));
    If(IsBlank(SelectedItem.thOurRef)||IsEmpty(SelectedItem.thOurRef),
        Notify("No record selected", NotificationType.Error));
    UpdateContext({Updated:false});

How do I get it to display the correct values?

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @stapes ,

    Could you share more detail with your scenario? What is "SelectedItem"? How does it from?

    If it is variable, your formulas will only show the selecteditem's value(previous). If you want to show current record value, you should pass the current record to Variable "SelectedItem". Please modify the Onvisble code as below: 

      UpdateContext({Tab1:true});
        If(!IsBlank(SelectedItem.thOurRef)||!IsEmpty(SelectedItem.thOurRef),
            ClearCollect(itemCollection,UpdateGoodsIn.Run(SelectedItem.thOurRef, SelectedItem.stCode)));
        If(IsBlank(SelectedItem.thOurRef)||IsEmpty(SelectedItem.thOurRef),
            Notify("No record selected", NotificationType.Error));
        UpdateContext({Updated:false});

        Set(SelectItems, First(itemCollection))

     

    If this doesn't make sense or i misunderstand , please let me know and share more details.

    Best regard,

    Sik

     

  • stapes Profile Picture
    894 on at

    Thank you v-siky-msft

    This is driving me nuts.

     

    SelectedItem is an Object that is passed from the previous screen.

    All the other fields on my screen are populated from this object.

    As you can see they are all populated.

    Except that Actual Qty Delivered in this case is actually set to 0 (Zero) in the database!

    Here is the data - from the Flow:

    response-from-flow.PNG

     

    screenshot.PNG

     

  • stapes Profile Picture
    894 on at

     

     

  • stapes Profile Picture
    894 on at

    I have not solved this issue. Whether the correct values get displayed on screen seems to be totally random.

     

  • stapes Profile Picture
    894 on at

    Here is another example.

    1) Values displayed on screen:

    POR029667.png

     

    The values displayed for Number of Pallets, Pallet Type and stBinLocation are all garbage!

    The flow picks up these values from the database correctly:

    noPalletsPalletType.png

    The Data Default Formula for these fields:

     

    If(IsEmpty(SelectedItem.NumberOfPalletsReceived),"",!IsEmpty(SelectedItem.NumberOfPalletsReceived),SelectedItem.NumberOfPalletsReceived)

     

    If(IsEmpty(SelectedItem.PalletType),"",!IsEmpty(SelectedItem.PalletType),SelectedItem.PalletType)

     

    If(IsEmpty(SelectedItem.stBinLocation),"",!IsEmpty(SelectedItem.stBinLocation),SelectedItem.stBinLocation)

     

    If I type anything at all in these fields in the edit screen, it corrects itself.

     

     

     

     

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @stapes ,

    How did you get the SelectItem? You saved the return of flow into a collection, so you have first to assign the first record of collection to SelectItem variable. Just append Set(SelectItem, First(Collection)) to OnVisible property of Screen.

    Then you can try to modify Defaults property of fields as below:

    If(IsBlank(SelectedItem.NumberOfPalletsReceived),"", SelectedItem.NumberOfPalletsReceived)
    If(IsBlank(SelectedItem.PalletType),"",SelectedItem.PalletType)
    If(IsBlank(SelectedItem.stBinLocation),"",SelectedItem.stBinLocation)

    Best regards,

    Sik

  • stapes Profile Picture
    894 on at

    I am getting my record in a previous screen. I get the collection here:

    (Screen OnVisible property):

     

        Clear(detailCollection);
        Set(LoadingSpinnerVisibility,true);
        ClearCollect(detailCollection,GoodsInDetail.Run(SelectedOrder.thOurRef));
        Set(LoadingSpinnerVisibility,false);

     

    That collection is the Datasource for a Gallery:

     

        SortByColumns(detailCollection,"QtyOS",Descending)

     

    The rows in the gallery have a select icon. On Select:

     

        Set(gvLastScreen,Screen3_OrderDetailV2);
        Navigate(Screen4_OrderItemV2, None,{
        SelectedItem: galOrderDetails.Selected,
        OrderRef: SelectedOrder.thOurRef
        });

     

    This way, SelectedItem is passed to the Item screen.

  • stapes Profile Picture
    894 on at

    Hi v-siky-msft

     

    I tried converting my form to use a new collection.

    I am getting it at the OnVisible stage:

        Clear(itemCollection);
        ClearCollect(itemCollection, ViewGoodsInDetailItemByID.Run(SelectedItem.ID)); Set(Selection,

        First(itemCollection));UpdateContext({Tab1:true});UpdateContext({Updated:false});

     

    My fields have this in the Default Data:

        If(IsEmpty(Selection.ActualQtyDelivered)||IsBlank(Selection.ActualQtyDelivered),

            0,

            !IsEmpty(Selection.ActualQtyDelivered),Selection.ActualQtyDelivered)

     

    But it makes no difference. It is still displaying values from the last data I input on a completely different record!

     
  • Verified answer
    stapes Profile Picture
    894 on at

    What seems to have cured it is putting explicit resets in for each screen field.

     

    Reset(txtActualQtyDelivered);Reset(dtDateDelivered);Reset(chbDeliveryAccepted);Reset(txtNumberOfPallets);Reset(chbPallletCondition);Reset(txtPalletType);Reset(txtBinLocation);Reset(txtProductStateTemp);Reset(dtExpiryDateChilled);Reset(dtExpiryDateFrozenFromChilled);Reset(txtConditionOfPack);Reset(chbVisualSpecCheck);Reset(chbRawMeatSpecCheck);Reset(chbHygeneOfDeviveryVehicle);Reset(chbCofACofCReceived);Reset(txtComments);Reset(txtWarehouseApprover);Reset(txtBatchCodes);Reset(chbExtraChecks);
    Clear(itemCollection);
    ClearCollect(itemCollection, ViewGoodsInDetailItemByID.Run(SelectedItem.ID)); Set(Selection, First(itemCollection));UpdateContext({Tab1:true});UpdateContext({Updated:false});

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard