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 / Problem updating a Tex...
Power Apps
Unanswered

Problem updating a TextLabel

(0) ShareShare
ReportReport
Posted on by 39

Hi!

 

I have a Text Label that display a number. In the "Text" property of that Label, I have a LookUp function to get that number:  LookUp(NameOfMyOtherSharePointList, Projet.Value = GalleryMenuProjets.Selected.Projets , Nbparticipants)

 

"GalleryMenuProject" is a Gallery on the left of the screen. The user select the project they want information about. I have another Gallery displaying informations from "MyOtherSharepointList" that is filtered based on the selected project in "GalleryMenuProjects" and gets me the result in a decreasing order relative to the date of creation. 

 

So I want that Label to show the most recent date in the "Nbparticipants" column.

 

My LookUp formula work just great. However, it does not update each time I select a different project. It does not keep the old number either, it just get blank. So I added a refresh button beside the Text Label (Refresh(MyOtherSharepointList)) and it works.

 

However, I would like to  find a way that do not require a "refresh button". 

 

I tried to add a command on the "OnSelect" Property of the GalleryMenuProject. There is already a "Set" fonction on that command so it goes like this: Set(SelectedId,ThisItem.ID); Refresh(MyOtherSharepointList) but it does not work.

 

Any ideas?

 

Thank you in advance!

 

Mimas

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Mimas 

    What kind of column is Projets in your Gallery?

    I would suspect there is a potential issue there.  You certainly do not need to do a refresh (in fact, rarely ever need to do that).

     

  • Mimas Profile Picture
    39 on at

    Hi,

     

    Thank you for your fast feedback 🙂

    My column is a LookUp column. 

     

    I agree that the refresh option is not ideal! (PS I have looked Shane Young video 😉 https://www.youtube.com/watch?v=gmYlJIjHS2M) But I haven't find my way around it yet!

     

    Thanks,

     

    Mimas

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Mimas 

    If your column Projets in your list represented in the gallery is a lookup, then change your label text formula to the following:

       LookUp(NameOfMyOtherSharePointList, ID= GalleryMenuProjets.Selected.Projets.Id, Nbparticipants)

     

    A lookup column will have the ID (seen as Id) of the foreign record as well as a Value column that is the linked column from the foreign list (usually Title).

     

  • Mimas Profile Picture
    39 on at

    Hi again,

     

    Actually I need to precise: In the "GalleryMenuProjets" on the left, that Users select project from, than "projets" is a "Single Line of text" column. 

     

    However, in the the Gallery from MyOtherSharePointList, than "Projet" is a LookUp column. 

     

    So in:

    LookUp(NameOfMyOtherSharePointList, Projet.Value = GalleryMenuProjets.Selected.Projets , Nbparticipants)

     

    Projet.Value refers to the Lookup column and

    GalleryMenuProjets.Selected.Projets refers to a Single line of text

     

    Sorry for the confusion.

     

    Mimas

     

    GalleryMenuProjets.Selected.Projets

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Mimas 

    Okay...then we were on the right track.

    Your formula should be working then if the Single Line of text Projets matches the Value in the Projet Lookup column.

    Are you sure you are trying to match the proper values?  Is the Lookup column defined to reflect the column from your foreign list that would contain the values that are equal to the single text column Projets in your primary list?

  • Mimas Profile Picture
    39 on at

    Hi Randy,

     

    Yes, the "GalleryMenuProjets" is made from a Sharepoint list that act avec the "Primary list" for the project. When the a new project is created, than a project name is written in a "Single line of Text" column. Than, MyOtherSharePointList refers to those project by selecting the project from a LookUp column that actually takes the values in the primary list (used to make the GalleryMenuProjets). So the values are correctly matching.

     

    Also, the LookUp formula in the Text Label field is giving the correct value. But it simply do not update if I don't refresh the Sharepoint list. 

     

    Mimas

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Mimas 

    Yes, but your formula is based on the selected record of the gallery...so, changing selection of the gallery will update the formula in the label - this is how PowerApps works...it's all dynamic and always evaluated just like Excel.

     

    In all of the formulas, are you referencing your datasources directly or are variables (including collections) used at any point?

  • Mimas Profile Picture
    39 on at

    That was my understanding also. It kind of confuse me that is does not update automatically.

     

    I do not uses any collections. I do use "set" a few times:

    1. As mentionned previously, when I click on a Project from the GalleryMenuProjets I have a "Set" command on the "OnSelect" property that goes like this: Set(SelectedId,ThisItem.ID)

    2. I also use Set(EntryTypeVar,"Edit") or  Set(EntryTypeVar,"New") when navigating between New/Edit form but I do not think that is relevant to the actual problem.

     

    I don't think I am using any other variables (but I am no programmer so I hope I understand your question correctly). As for the "Set ID" I mentioned in point 1 above... I though about using it but in my  MyOtherSharePointList, user select project names from a LookUp, as mentionned before, and I did add a column to add the Projet ID automatically but it is a dependency from the LookUp ('ProjetLB:ID')... I do not seems to ba able to refer to that very well....

     

    Hope it answers your question! 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Mimas 
    Good that you're not a programmer as PowerApps is not a programming platform.  It is formula based like Excel.

     

    The variables you mention will not impact anything.  The EntryTypeVar is not needed, but that's another topic.

     

    Now, let's troubleshoot a little bit.  Put two labels on your screen and set the Text properties as follows:

    Label1 -   GalleryMenuProjets.Selected.Projets

    Label2 -   CountRows(Filter(NameOfMyOtherSharePointList, Projet.Value = GalleryMenuProjets.Selected.Projets))

    You might see some delegation warnings, but we're not concerned over that at this point (unless your other share point list is more than your record limit).

     

    Observe:

    1) Does the label1 text change as you click on different items in your gallery?

    2) Does Label2 show anything other than 0?

  • Mimas Profile Picture
    39 on at

    Hi Randy,

     

    Thanks again for your help! 

     

    To answer your questions:

    1) Does the label1 text change as you click on different items in your gallery? Yes! I actually had tried that before and even changed the LookUp formula to compare the project name with the text Label instead of directly to the Gallery but it doesn't help the problem.

    2) Does Label2 show anything other than 0? Yes! It does count the good number of rows.

     

    Mimas

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard