cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Year collection run manually

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: Year collection run manually

@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.

View solution in original post

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: Year collection run manually

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.

Highlighted
Helper III
Helper III

Re: Year collection run manually

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

Highlighted
Solution Sage
Solution Sage

Re: Year collection run manually

@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.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Year collection run manually

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
Highlighted
Community Champion
Community Champion

Re: Year collection run manually

Thanks @GarethPrisk 

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

 

 

 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,395)