web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Variables not updating...
Power Apps
Unanswered

Variables not updating at the same time with my datasource

(0) ShareShare
ReportReport
Posted on by 38

Hi,

 

I have the following situation. I have a datasource (excel table, can't do it otherwise) and values from it changes (one of it, for example, is a status). I have some variables in my app that, with the help of a timer, these are trying to give me some values from my datasource. Like, monitoring the status. I refresh my table, my datasource, frequently (with a timer) and it's doing it quickly. I have a gallery and I see the changes made in the back, in the excel table and these changes reflects very quickly it this gallery but not at the same time in my variables. It takes too long to see that  the content of my variables is different.

Currently the no of the records in the table is small, for testing (less than 10), I don't think that I could use collection as the datasource keeps changing. 

For a variable I use LookUp(Table1, ThisRecord.SomeColumn = SomeVariable).Status

 

Is there a way to make the updates to reflect simultaneously in my table and in my variables, cause it is not ok to take more than 10 - 20 sec to see the changes in the variables too?

 

Thank you!

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @ClaudiaK,

    I think you could short the duration of the Timer, 10-20 sec is too long for retrieving a record, try to short it into 1-2 sec.

  • ClaudiaK Profile Picture
    38 on at

    Thank you for your reply! It does nothing to do with the timer as its duration is set to 2 sec.

     

  • ClaudiaK Profile Picture
    38 on at

    The timer refreshes the datasource every 2-3 sec and so my variables. But I can't see the changes in the variables just after so, so much time. They do change, but not at the same time as I can see in my gallery.

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @ClaudiaK,

    I have a test on my side, please check for details:

    vqiaqimsft_0-1683618085468.pngOnce I submit the form, I could see the variable in the label.

    You could compare the settings with yours in your scenario.

  • ClaudiaK Profile Picture
    38 on at

    Thank you so much that you are taking your time to try and help. Sorry that I did not put more of my code in the post! Here's what I have tried already, I did tried putting code on OnTimerStart/TimerEnd, I have put first all the code together with the refresh function, played, separated them. Those noted with X are variables that do not update  at the same time with my gallery.

    P.S. The download button must turn orange/enabled too and the status, to show 'Done' but they do this just after a long time. I have just a few records for test.

     

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @ClaudiaK,

    This scenario is a little bit complex, could you please tell me where and which container you put in this Timer?

     

    You refer to ThisRecord parameter, which needs updatecontext.

     

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @ClaudiaK 

    In this situation, a better approach would be to use a named formula rather than a variable.

    CurrentStatus = LookUp(Table1, ThisRecord.SomeColumn = SomeVariable).Status;

    A named formula will return the up to date value following an update to your Excel data source.

    There are more details here.

    https://powerapps.microsoft.com/en-us/blog/power-fx-introducing-named-formulas/

     

  • ClaudiaK Profile Picture
    38 on at

    Hi Qi,

     

    I tried first these:

    'Last(Filter(Table1,CUI=DataCardValue1.Text)).FilePath or .Status '

    and

    'Set(cValueStatus, Last(Table1).Status)'

    But I do have cases when I don't add a new record, I update an existing one, so I can't reference Last and thus I created variables.

    Do you have a suggestion for me to try?

    The timer is outside the gallery, I'll hide it in the end.

    Thank you!

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @ClaudiaK,

    I agree with @timl that a named formula maybe better.

    There is dependency in your formula, which may affect the performance.

  • ClaudiaK Profile Picture
    38 on at

    Hi @timl , 

     

    Thank you for your suggestion and your message! I'll try this now. Although, being experimental, my thought  is that I wont be able to go this road because it's experimental feature, but anyway I want to try this too to see if it can fix my problem.

    Thank you!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard