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 / Year collection run ma...
Power Apps
Answered

Year collection run manually

(0) ShareShare
ReportReport
Posted on by 257

Hi everybody

I created  year collection and linked it to a drop down that contains formula when the user open the app the year will be displayed automatically on the current year.

 

Years Collection button on select formula:

Collect( Years, { ID: "1", Value: 2019 }, { ID: "2", Value: 2020 }, { ID: "3", Value: 2021 })

 

Dropdown Items "Years"

Default

LookUp(
 Years,
 Value = Year(Now())
).Value

the issue now every time I open the app I should click on the collection button to run it, please I need it automatically anyone can help?

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,315 Most Valuable Professional on at

    Hi @gme-eg ,

    You can run it at App OnStart - this will run every time the app is openedOnStart.jpg



     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Ghada Mehrez Profile Picture
    257 on at

    Thanks a lot for support but it is still needs to be manually also I run it from the app and I added it to the app on select formula

  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    @WarrenBelz  is correct; to have the Collection automatically be set, you will want to use the app's OnStart property and load the collection there. Note, it will execute automatically the first time you edit in the Studio, but must be toggled afterwards. Normal app loads will run the function as expected.

     

    I can't tell the exact behavior you're expecting, but here are guesses:

    1. [Most Likely] The Dropdown has the current year selected when a User sees the control
    2. The Dropdown should be blank until a User clicks on the control, then it sets the current year
    3. Some other manual click from the User to create the collection, then default the Dropdown

     

    If you're looking for the standard default, your formula looks correct. However, you need to correlate the Value property of the Dropdown to what the Default is passing. See screenshot:

    DropdownControlDefault.png

    The Value list on the property pane for the Dropdown shows the available fields, from the Items being passed to the Dropdown. It's not a property you can set, but you can select it here. Yours might be set to ID. Replicating the above will give you a Defaulted year value in the Dropdown.

  • eka24 Profile Picture
    20,925 on at
    Please what @WarrenBelz is the way to go if you want it automatically done instead of manually as you want. Put it Onstart as he said
  • WarrenBelz Profile Picture
    155,315 Most Valuable Professional on at

    Thanks @GarethPrisk 

    One small small thing to add - you can run App OnStart during developmentAppOnStart.jpg

     

     

     

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 977

#2
Valantis Profile Picture

Valantis 664

#3
11manish Profile Picture

11manish 530

Last 30 days Overall leaderboard