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 / SET GLOBAL VARIABLE FR...
Power Apps
Answered

SET GLOBAL VARIABLE FROM LATEST VALUE IN SHAREPOINT LIST

(0) ShareShare
ReportReport
Posted on by

I have a sharepoint list that is automatically populated with a daily exchange rate (Columns: CurrencyCode, FxDate,FxRate) and am trying to set a global variable (FxR) with the OnStart property of my app.

I am using the following, but it doesn't seem to be populating the variable.

 

What am I doing wrong?

 

Set(FxR,First(
FirstN(Sort(FxRates,FxRate, Descending),
1
)
)
)

Categories:
I have the same question (0)
  • HenriDesmet59 Profile Picture
    295 on at

    Hello @ICEMAN65 ,

     

    If you want to bind the latest value to a global variable from a SharePoint List, you can write the following : 

    Set(LastItem,First(Sort('test liste';ID;Descending)))

    The Sort by ID get you the last item in the first place. 

     

    Tell me if It's ok for you 🙂 

     

    Henri

  • ICEMAN65 Profile Picture
    on at

    That still isn't working I don't get a value in my variable. It doesn't seem to be picking up the value i need from the relevant column in my sharepoint list.

  • Verified answer
    HenriDesmet59 Profile Picture
    295 on at

    How do you use your variable ?

    When you put the item in the variable, to get the value of a column you need to write : 

    LastItem.Column

     

  • Verified answer
    timl Profile Picture
    37,112 Super User 2026 Season 1 on at

    @ICEMAN65 

    I note that your formula sorts by FxRate in descending sequence. Therefore, I suspect that sorting by FxDate will produce the correct result.

    Set(FxR,
     First(
     FirstN(Sort(FxRates,FxDate, Descending),
     1
     )
     )
    )

     

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard