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 / Change DropDown Value ...
Power Apps
Unanswered

Change DropDown Value on button onselect

(0) ShareShare
ReportReport
Posted on by 12

Ok so I have a dropdown in my powerapp for the status of a record. At the moment to make the default value to "Open" I have the following 

 

DefaultSelectedItems : If(AuditBuildingForm.Mode=FormMode.New,{Value: "Open"}, Parent.Default)

 

Field is called Status

 

This works perfectly to set the drop down to Open when i first create the form. 

 

From here the author might save the file for later or complete the form. When they complete i want them to click a button to Complete which will do a few things (submit the form, send a message to teams) including change the entry in the Status dropdown to "Complete"

 

Yes "Complete" is an option in my drop down list. 

I have tried about 10 different way to get this to work and it still does nothing. Ideas please ?

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Hi @heieup - what is your data source? SharePoint? Is the Status field a Choice column? If yes, assume it is single choice?

  • heieup Profile Picture
    12 on at

    Hi the data source is a sharepoint list, the field is a Choice field with 3 options, - open, complete and closed. 

     

    I am using DefaultSelectedItems to set the field to "open" when the record is first created and then when the person has completed the form i want to click a button and change this to "Complete" yes Complete is an option in the list.

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Hi @heieup ,

     

    You can use a Patch on the OnSuccess property of the Form. For example:

     

    Patch(
     'Your Data',
     LookUp(
     'Your Data',
     ID = AuditBuildingForm.LastSubmit.ID
     ),
     {'Your Choice Column': {Value: "Complete"}}
    );

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

     

     

  • heieup Profile Picture
    12 on at

    Hi, this doesn't work, LastSubmit isn't recognised and also if i add this into the onsuccess for the form wouldn't it update every time I submit the form ? I only want to do it when it is completed. So I have a button to save and continue later and another button to complete. I only want to update the drop down to Complete when I click the complete button.

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Hi @heieup ,

     

    The expression pattern does certainly work. Could you share the expression you have used and what the error message (if any) is?

     

    How do you define what a “Complete” form is? If all the Required fields in the Form have been filled in, or specific fields?

  • heieup Profile Picture
    12 on at

    Ok so i retyped the data in and dont get the error i had last time but this updates every time i save the form. I only want to change this drop down based on a specific button click. 

     

    I tried putting the code above in the OnSelect property for the button and nothing happens.....

     

    The person doing the audit can save for later or complete the audit - they decide when the audit is completed. Using the syntax above change the status to complete every time the form is submitted no matter which button they use to submit and navigate away from the page. 

     

    To clarify, this is an audit form. The person doing the audit can save and come back later to complete the audit OR they can mark it as completed. I have two buttons on the bottom of the form, if they want to save and come back later they click a button which submits the form and navigates back to the menu page. If they are done and want to mark it as compelted I want them to be able to click a button that will change the value in the Status drop down - from Open to Complete and save the form (I am using SubmitForm for this) and navigate back to the menu. 

     

    Any ideas ? Using OnSuccess makes the change every time i submit form, no matter which button they click. 

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard