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 / Custom dropdown value ...
Power Apps
Unanswered

Custom dropdown value not sticking

(0) ShareShare
ReportReport
Posted on by 248

Hello and happy Monday.

 

I inserted a Dropdown with an array for items [0, 1, 2, 3, 4, 5].  The user is asked "How many courses are they creating?" and based on the number chosen, that number of rows appear for the user to fill.  This works perfectly.  The issue that i am finding is that when the form is opened in Sharepoint, the dropdown defaults back to "0". 

 

I have tried updating a variable (named LastComponent) in the OnSelect and OnChange property.  The default property shows If(FormMode.New=true, "0", LastComponent).  I pulled a Label and had it equal to LastComponent to see the value that comes through and it shows the correct value.

CSSD.PNG

I'm cant figure out where to go from here.

 

Thank you for your time

Categories:
  • eka24 Profile Picture
    20,925 on at

    What do you want in the dropdown in EditForm and New form. Can you explain further

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Misa Profile Picture
    248 on at

    @eka24 

     

    Hi and thank you. 

    On the new form it should say 0.  In the Edit and View forms it should show the saved value. 1-5.

     

    One thing i forgot to mention is that the dropdown is not tied to a Sharepoint or datasource.

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Misa ,


    You want to set the Default value of dropdown based on the form mode, right?

    Please try this:

    If(FormName.Mode=FormMode.New, 0, LastComponent)

    Hope this helps.

    Sik

  • Misa Profile Picture
    248 on at

    @v-siky-msft 

     

    Good morning and thank you.  What i am finding is that when the form is open (for editing or viewing) the dropdown value stays at 0.  It does not show the value that was saved.

     

    I used the formula that you suggested and the same thing is happening 😞

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Misa ,

     

    How do you define the LastComponent variable? Which Form are you refer to? 

    I just find a editable Gallery from your screenshot. Please share more information about your App.

     

    To debug if the issue is from LastComponent variable, please try this code to see if these logic works for your case? 

    If(FormName.Mode=FormMode.New, 0, 5)

    Sik

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 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard