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 / OnStartup Variables
Power Apps
Answered

OnStartup Variables

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I'm attempting to set a variable OnStartup.  Essentially, I want to pull the largest ID from my Sharepoint table and set it as a variable so that it is immediately usable as the largest ID to create a more custom ID.

 

OnStartup:

Set(varTXSOEntry,Value(SeqID.Selected.ID));

Where SeqID is the dropdown that I'm refencing the ID from.

 

I'm attempting to put varTXSOEntry into a text label with the formula:

 

"TX" & Text(varTXSOEntry,"01000")

 

The problem I'm running into is that even though my startup function is showing a SeqID = 85, my output to my text label is showing a value of 0.

 

Any advice?

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

    @cborde3 

    Go to settings and turn on Named Formulas

    Then go to Apps.Formula and put in

    wTXSOEntry=First(Sort(splist,ID,Descending)).ID;

     

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Do you mean the OnStart property? If so, referencing a controls selected variable in the app is always going to return 0, the app just started, there is no selected control states yet.

     

    If you are just looking to set a variable for msot recent splist in the onstart do somethign like this

     

    Set(varStart, "TX" & Text(Last(SPLISTNAME).ID&"01000"))

     

  • CU06081315-1 Profile Picture
    on at

    Thank you.  This worked.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard