cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tomato_Pie
Regular Visitor

Lookup() label text vanishes a moment after loading

Hi everyone. I'm new to Power Apps, and am wondering if any of you can help me with this strange little bug I'm experiencing.

 

I have an edit form with a datacard that displays a barcode value from a sharepoint list. The value of the datacard can be changed by the user, either by typing, or by using the built-in barcode scanner functionality, then submitted if desired. All this works great, the barcode is in the datacard value box.

 

Within that same datacard, I have a label that grabs the datacard value, and uses the LookUp() function on the sharepoint list to retrieve and display the title associated with the barcode. It uses the function below in it's "text" property:

 

LookUp('List of Devices', OData__dlc_BarcodeValue=DataCardValue37.Text).Title

     (where DataCardValue37 contains the barcode)

 

This all works great within the app editor, but gets weird when fully run in the browser or on my android phone. Sometimes these lookup() labels work, but sometimes they load and display for a moment, then immediately disappear. I find that it happens more often on my phone. Updating the barcode field by backspacing and retyping the last number causes the lookup() label to reload and display properly again.

 

Strangely, I have the exact same lookup() label setup on a detail form, and it works just fine every time.

 

Any ideas of what's going on? Why does this work on a detail form but not an edit form? Is there any way I can force the labels to refresh themselves a moment after the page loads so that their text reappears? Any help you might able to provide would be highly appreciated.

 

Thanks!

problem.png

 

15 REPLIES 15

Hi WarrenBelz,

 

I found some interesting info while implementing different variations of your suggestion.

 

It looks like transplanting the lookup label from inside the datacard to outside of it fixes the issue. I'd love to know why. I noticed that after cutting and pasting the label, its DisplayMode changed from .Edit to .View, so I tried playing with the display modes in different ways but it had no effect.

 

Having the labels outside of the datacards prevents the label from scrolling with the screen though. Do you know of any ways to have it scroll while being outside the datacards?

 

Having the labels read from other cards based on the value of DataCardValue36 like in your suggestion had no effect unfortunately.

@Tomato_Pie ,

Strange, as you can set a label inside a card to anything you want - I do it all the time in Custom Cards when I want to display a heap of read-only information from different fields.

A rather "clunky" workaround would be to put the label outside the form and hide it and then base the value of one inside the card on the one outside.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi WarrenBelz,

 

Ok now this is really strange:

 

So I have the lookup label (Label1) outside the Data Cards. Everything works great, the title appears.

 

I add a new label inside the Data Card. I set it's text as Label1.Text, but now it gives me an error. Apparently I've created a circular reference? How can I have created a circular reference when this is a completely new label just parroting text in another label? Huh?

 

One way to get around this is to create this same new label outside of the Data Card, and cut&paste it into the Data Card. It no longer complains. Except now when I publish and launch the app, text in Label1 has now disappeared. 

 

What on earth is going on??

 

Edit: Ok I've found a workaround

If I put my barcode calculation and lookup calculation all inside one label, using BrowseGallery3.Selected instead of Parent.Default, it appears to work inside of the Data Card. But now this doesn't allow the label to update when the user types new info into the edit form textbox, which is a pretty critical feature.

Thanks @Tomato_Pie ,

Another way would be to set a Variable at Screen OnVisible based on the Lookup, then change the Variable when the item is scanned. Your could then display the Variable in a Label in the card.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi WarrenBelz, thanks again so much for your help.

 

I like that idea, except this title also needs to respond to users manually typing barcodes into the barcode edit form box. Is there a way to make the variable detect and respond to when a user has typed in a textbox?

 

In other words this variable needs to perform its lookup on the most recently updated of the following: The default barcode value (what it was set to before the edit screen was loaded), the value from the barcode scanner, and the user's typing input into the edit form's barcode DataCardValue. Referencing this DataCardvalue is what seems to cause all these issues.

Hi @Tomato_Pie ,

You would set the Variable to the Lookup of the barcode on the OnScan of the scanner or the lookup of the Text Box using the OnChange event.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,243)