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 / Using collection for d...
Power Apps
Unanswered

Using collection for dropdown does not show results on Edit

(0) ShareShare
ReportReport
Posted on by 84

I have a SP list and canvas app, My data cards have text input and dropdown selection, I only need to see text input in sharepoint list and that works fine but when users edit form I want the selected value of the dropdown to be displayed.

When I submit form here is the code: there is 148 dropdowns total but I shortened it for this example.

SubmitForm(EditForm1) ;
Collect(DropDownSelections, {
SQ1 :sDropdown1_1 .SelectedText, 
SQ2 :sDropdown1_2 .SelectedText})

I've tried on start of application: Thinking this would make a difference

LoadData(DropDownSelections, "DropDownSelections")

 The default property of the dropdown I have tried so many scenarios its garbage to post. But here goes.

DropDownSelections(sDropdown1_1.SelectedText)

A simple snapshop of the dataCard.

7.png

The application works fine except that when user edits the form I want the previous selected dropdown selection to show also.

Categories:
I have the same question (0)
  • TylerPA Profile Picture
    201 on at

    @nor3msti ,

     

    What are your Update fields set to for your datacards? Unless I'm misunderstanding why you're collecting the dropdown values / misunderstanding your card setup - please let me know:

    • Card Update field would be 'Dropdown.Selected.Value'. This would update a text field on sharepoint
    • The dropdowns Default can be set to 'Parent.Default'. When editing, the dropdown would select the current existing value for that record being edited
  • nor3msti Profile Picture
    84 on at

    The data card update property is

    BrowseGallery1.Selected.'1. DO ALL EMPLOYEES ATTEND AND PARTICIPATE IN THE BEGINNING OF SHIFT SAFETY MEETING?'

    When i change it to your option, the textbox displays the text from the drop down menu. 

    When i save this form to share point, the textbox has text that saves to the sharepoint list, the dropdown is only on the canvas side of the app so i created a collection to store the selected values.  However when i return to edit the form the dropdown values are not there, the dropdown resets back to original state.

  • TylerPA Profile Picture
    201 on at

    Ok thanks - as another check:

    • What are your Items and Default properties of the dropdown set to?
    • What is the default value of your data card set to?
  • nor3msti Profile Picture
    84 on at

    Items

    ["", "Compliant", "Non-Compliant"]

    Default property: Well I've tried about every scenario on this site and nothing is working so its "1" for now.

    Default datacard:

    ThisItem.'1. DO ALL EMPLOYEES ATTEND AND PARTICIPATE IN THE BEGINNING OF SHIFT SAFETY MEETING?'

     The text box property is Parent.Default  < no issues with the textbox.

    and again, dont need the dropdown selection to save to sharepoint, i just want the last option selected to be viewable when editing the form.

  • TylerPA Profile Picture
    201 on at

    @nor3msti thanks - and to confirm:

    • for your dropdown default property - Parent.Default is not working?
    • if that's still not, try for default property: First(Filter(["", "Compliant", "Non-Compliant"], Value=Parent.Default)).Value
  • nor3msti Profile Picture
    84 on at

    no, its not reataining the selected item, Do I need to remind you I added this dropdown to the datacard, its not in the sharepoint list at all so the parent would be the collection correct?

  • TylerPA Profile Picture
    201 on at

    nope, even if you add a new dropdown Parent refers to the source for that data card. it doesn't refer to the Items property of the dropdown

     

    I've been trying both ways (using a Choice field, and collection), and been getting it to work with both those prior suggestions- apologies for what appear redundant questions

     

    Feel free to message an export of the app, and a csv of the list - I can take a deeper look later if you'd like

  • nor3msti Profile Picture
    84 on at

    I sent you a message with link to program,

    thank you for the help

  • TylerPA Profile Picture
    201 on at

    @nor3msti ,

     

    Ok - that helped a bit. I misunderstood how you were using your dropdown/text fields

     

    Since you have ~150 columns, which update on a text field based on the text input. You are trying to also retain separate dropdown values, without adding a separate sharepoint column to do so

     

    I would not recommend your current approach (save data, load data, collecting the dropdown values...). Very complex

     

    I would suggest a different approach to saving your entries. This will simplify things a bit compared to the current approach, but also retain the information to sharepoint

     

    // change your Cards update property to this. you can replace "***" with a different convention if you want, you just don't want it to be text that could appear in an entry
    
    Concatenate(sDropdown1_1.Selected.Value, "***", sTextInput1_1.Text)
    
    // change your dropdowns default to 
    First(Split(Parent.Default, "***")).Result
    
    // text fields default to
    Last(Split(Parent.Default, "***")).Result

     

    What sharepoint looks like:

    TylerPA_0-1669143405841.png

     

    What App looks like:

    TylerPA_4-1669143906632.png

     

     

    You would need to make some updates to your galleries and display forms accordingly. Otherwise, if you do not prefer this approach - I think the alternate truly is to create a separate sharepoint column for each dropdown

  • nor3msti Profile Picture
    84 on at

    ok, so this will work with a few exceptions, 

    would it be better to use radio buttons instead of dropdowns, I assume the same concept,  

    using this, on a new form the dropdown is already showing the last selection from the previous selection. how to correct that?

    This isnt working

    If(FormMode.Edit, true, false);
    First(Split(Parent.Default, "***")).Result

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard