cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CPalaloga
Frequent Visitor

UpdateContext issue the second run with OnChange Reset

I have a table stored in a collection.

In a input text field I write a serial number. When the text field OnChange is executed, it will look in the collection and save the value in a variable and reset the text field. But this only works the first time when the page is loaded.

 

After the first execution, I believe that it doesn't have sufficient time to write the result in the variable.

 

Why is it that the first time it works and then it doesn't? How can I bypass this (I wouldn't like to use a timer - is used in a gallery)?

 

UpdateContext({AuxVariable:First(Filter(SerialNumber,SN=Self.Text)).Partname});
UpdateContext({InputReset:true});
UpdateContext({InputReset:false});

2 REPLIES 2
Drrickryp
Super User II
Super User II

Hi @CPalaloga 

Could you please submit a screenshot that illustrates where in your app the problem is occurring.  

CPalaloga
Frequent Visitor

This are the main elements:

CPalaloga_0-1612188033649.png

User click on the part scan:

OnSelect: 

  • UpdateContext({PendingPart:true});
    UpdateContext({AuxVariable:""})

CPalaloga_1-1612188085831.png

This will place a mask (PendingPart) over the input text (for users to not see the part number). This is meant to be used only for scan process, no manual input of numbers.

 

Users use a special code scanner and adds the code in the field. Once the code is added, the OnChange is executed:

  • UpdateContext({AuxVariable:First(Filter(SerialNumber,SN=Self.Text)).PartName});
    UpdateContext({InputReset:true});    //InputReset is added to the text input field
    UpdateContext({InputReset:false});
    UpdateContext({PendingPart:false})

CPalaloga_2-1612188254631.png

The first time, when the screen is loaded, it works without any issues. If the change is not changed and a new or the same part is scanned, it will not work.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,449)