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 / Saving and Retrieving ...
Power Apps
Answered

Saving and Retrieving Gallery Dropdown

(0) ShareShare
ReportReport
Posted on by 12

Good morning,

 

I have what I thought was an easy scenario but I am going round in circles. I am new to Power Apps so apologies if I am missing the obvious. 

 

I have a gallery with a dropdown box, three text entry elements and a text box that calculates a value based on what the user has input in the other fields. I have a button to add additional rows to the gallery as each user may input a different number of rows. 

 

I am able to save the entry to a dataverse table but trying to retrieve the entry so the user can edit it when they log back in is causing me issues. 

 

If the user hasn't saved anything into the table, the dropdown box needs to populate the options. If the user has saved anything to the table, it needs to retrieve that and populate the fields, but the dropdown has to have all of the other options so the user can change it. As I am typing this, I am not sure how I would go about this bit anyway. 

 

Any help would be appreciated. I haven't posted any of the code as I would like to know if I am trying to do something that isn't supported. 

 

Thanks!

Categories:
I have the same question (0)
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @PaulSMV,

    Do you want to populate the dropdown with a default value if current user has entry before but keep other options in the dropdown list?

    Could you please tell me what you want to populate if there is multi entry of one user, define the retrieved first record?

     

    Anyway, this issue is not that complex, you could set the Dropdown box Items property as below:

    Choices(TableName.ColumnName)
    

    set the Dropdown box Default property as below:

    LookUp(TableName,'Created By'.'Primary Email'= User().Email).ColumnName

    I assume that you use the default 'Created By' column to retrieve the current user's record, and I assume the column you used to populate the dropdown box is a Choice column.

  • PaulSMV Profile Picture
    12 on at

    Hi @v-qiaqi-msft,

     

    Thanks for the help. I have managed to get a bit closer to my goal.

     

    I have a dataverse table which I am loading into a collection. 

     

    ClearCollect(colTeachingActivity2, teaching_activity)

    I have set the items property of the gallery to this collection. This is because I have a button that adds a row to the gallery 

     

     Collect(
     colTeachingActivity2,
     {
     'activity_type_1 (teaching_activity)': Choices(teaching_activity.activity_type_1),
     Number_of_Students: 0,
     Event_Duration: 0,
     No_of_Events: 0
     }
    )

     

    I have set the dropdown using the method you described. The issue I have is that if the dataverse table is empty, the gallery doesn't display anything to the user. This makes sense but I am not sure how to get around it. I have tried various things on the default value of the gallery itself with no success.

     

  • PaulSMV Profile Picture
    12 on at

    Ignore the above. The button adds a row to the table so all works as it should. 

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 1,027

#2
Valantis Profile Picture

Valantis 644

#3
11manish Profile Picture

11manish 626

Last 30 days Overall leaderboard