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 / SaveData and Populatin...
Power Apps
Answered

SaveData and Populating Dropdown and Combo box

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Everyone,

 

I have an app that scans barcodes, and collects them.

There are also DropDown boxes / Combo Box , and the selected values are collected while being scanned. (Each selected value is applied to each scan) 

This app uses SaveData after each scan. So once you leave the app, it's able to restore the data as LoadData is applied OnStart. 

 

When I exit the app, and reopen it. The selected values from DropDown boxes / Combo Box are empty again. 

 

How can I populate the Dropdownboxes with SaveData information in the collection? 

 

Thank you, 

 

 

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

    Hi @Anonymous ,

    What are the Items of the drop-downs? They need to be based on the collection (or hard-coded) if you are wanting them to work offline.

     

    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.

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous :

    I think I may understand what you mean, if my understanding is incorrect, please help me to point it out.

    • The BarcodeScanner OnScan event performs the following operations:
      1)Collect barcode into collection
      2)Save the collection locally
    • Load the collection when the app opens
    • When the program is opened, the dropdown control selects the most recently scanned barcode by default

    I think this can be achieved by setting the default property of the dropdown control.

    I've made a test for your reference:

    1\OnStart:

     

    LoadData( MyItems, "LocalSavedItems" ) /*MyItems is my custom collection*/

     

    2\Add a BarcodeScanner control(BarcodeScanner1):

    OnScan:

     

    Collect(MyItems,{Barcode:BarcodeScanner1.Value,date:Now()}); /*Record scan time is used to filter the last scan record*/
    SaveData( MyItems, "LocalSavedItems" )

     

    3\Add a dropdown control:

    Items:

     

    MyItems

     

    Default:

     

    First(Sort(MyItems,date,Descending)).Barcode

     

    I tested it on my phone. Every time I reopen the app, the dropdown control always selects the most recently scanned barcode by default

    Best Regards,

    Bof

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard