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
)
)
)
Solved! Go to Solution.
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
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
)
)
)
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
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.
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
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
)
)
)
User | Count |
---|---|
252 | |
107 | |
88 | |
51 | |
44 |