web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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

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
    153,084 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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard