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 / How to disable choice ...
Power Apps
Answered

How to disable choice in combo box after form is submitted

(0) ShareShare
ReportReport
Posted on by 114

I am looking for a way to remove or disable a combo box choice after it is selected and user submit the form.

I have an app for student to vote  on his/her assigned projects.

What the app does?

Student has to vote for the assigned projects from the most interested to the least. 

Each student is assigned to 4 projects.

Once the student selects the assigned project name, selects his/her class, selects the interest scale and enters a brief comment then submits the form.

The data is then written to the SharePoint List.

What I am looking for?

Once the student submitted the form for each project choice, I need the submitted choice to be disabled.  He/she can only vote once for each project and not able to go back and edit once the form is submitted.

Once all 4 assigned projected is voted and submitted then the Project Name Combo box choice will also be disabled.

Question?

Is this even possible in power app?  I am willing to listen for alternative recommendations.

This is a screenshot of the editform app.

davidvo68_0-1648817955054.png

 

Thank you.

Categories:
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    Will this all be filled out in 1 session? That would make things easier. 

    You could use a Collection to hold the DropDown choices. Then as each project is submitted you would just remove that choice from the collection. Once your collection becomes empty (you can check with the IsEmpty() function) then you can use that to set your DropDown's Visible property.

    If they can do this over more than one session, you will need to complicate things a little with the SaveData function for your Collection

  • davidvo68 Profile Picture
    114 on at

    Thank you for your quick reply Brian.

    I never work with Collection so not sure how to pursue from your tip.

    I will look on Microsoft Document and if I am able to solve this by using Collection then I will accept your reply as solution.

     

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    Collections are just a way of saving tables or fields into the memory of the device for quick retrieval. You would create the collectio in the OnStart of the app. Something like:

    ClearCollect(col_Projects,["Project1","Project2","Project3","Project4"])

    Then your ComboBox would have col_Projects in the Items Property. Once someone filed out the form you would add some code after the Form was submitted:

    RemoveIf(col_Projects,Value=Form.LastSubmit.ProjectName)

    substituting the name of your Form and the field name

    For the Visible Property of your ComboBox you would use:

    !IsEmpty(col_Projects)

    which make make it invisible when the last Project form is filled out.

    Hope that gets you started

  • davidvo68 Profile Picture
    114 on at

    OnSelect of IconAccept1's Property I have the below code.

    SubmitForm(EditForm1); RemoveIf(col_Projects,Value=EditForm1.LastSubmit.'Project Name')

    However, it is giving an error. Here is the screenshot of it.

    davidvo68_0-1648827613370.png

     

  • Verified answer
    BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    It could be that you are actually saving the entire Record from the ComboBox. I imagine there is a way to get what you want from that record, but I would need to see the data. The easiest thing may be to set a variable to just the project name before you Submit the form. In the OnChange of the ComboBox use:

    Set(var_Proj, Self.Selected.Value)

    Then change your RemoveIf to:

    RemoveIf(col_Projects,Value=var_Proj)

    That should get you what you need

  • davidvo68 Profile Picture
    114 on at

    Thank you so much Brian.

    It worked.

  • davidvo68 Profile Picture
    114 on at

    Hi Brian,

    Since each student is assigned to the same 4 projects for them to vote on, I like to only remove the voted project choices per student after they voted.

    Example:

    Student A, Student B and Student C all have been assigned to the same Project A, B, C, and D.

    Student A voted on his Projects A, B, C, D then he is done.  Next time he logs into the app, he should not see any choices appear in the Project combo box.

    Meanwhile, Student B has not voted for his projects and he should see all 4 project choices on his Project combo box after he logs in.

    How can I accomplish this?

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    In that case I would add a Boolean field to the Student's record (StudentVote). Once the student submits a vote, change that value to true. Then you can set the DisplayMode of the project selector based on that new field:

    If(StudentVote, DisplayMode.Disabled, DisplayMode.Edit)

     

  • Kami125 Profile Picture
    2 on at

    i have one econobox and in 5 items , then i select one item then combo box is disable please give me a solution ?????????????????????????????????????????????

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard