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

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
    36,383 Super User 2025 Season 2 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

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