cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
qfatima
Frequent Visitor

Update to a different dropdown value

Hi! 

 

In my Power App, when user clicks an "Update" Button, I want the drop down value of one of the fields to change. 

 

Status is set as "New Bid" by the user when created. When I go to a certain page on my app, input details and hit update button, the status should change from "New Bid" to "Installation Input". 

 

error1.png

 

I've played around Set, Update Context functions but with no much luck. Any leads?

 

1 ACCEPTED SOLUTION

Accepted Solutions
qfatima
Frequent Visitor

Re: Update to a different dropdown value

Hi @mdevaney  and @v-siky-msft 

 

Thank you for your messages. It is a dropdown value, and also, I realized there's a simpler way to update the value of status (without using any default and hidden variables): 

 

Patch('Bid Management_1', First(Filter('Bid Management_1',Title = EditRecord.Title)),{Status:{Value:"Installation Input"}});

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Update to a different dropdown value

@qfatima
I believe this can be accomplished by making use of the Reset and Default properties of your dropdown control.

Put this code in the OnVisble property of the screen

Set(updateStatus,false);
Set(defaultStatus=“New Bid”);


Put this code in your Update button

Set(updateStatus,true);
Set(defaultStatus,”Installation Input”);
Set(updateStatus,false);


Put this code in the Reset property of your dropdown

updateStatus


Put this code in the Default property of your dropdown

defaultStatus


Note: this solution assumes the initial status is always New Bid upon entering the screen.

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Community Support
Community Support

Re: Update to a different dropdown value

Hi @qfatima ,

 

Which control do you use? drop down control or combo box? Can you share the items property of it?

What is the date type of Status column? Choices?

I have made a test on my side, you can use variable to control the default of drop down.

1. Put Set(Var1,false) to OnStart of app or OnVisible of screen;

2. Put Set(Var1,true) to OnSelect of update button;

3. Set Default property of drop down as below:

 

If(Var1,"Installation Input","New Bid")

 

If the control is combo box, there is one difference.

you need to set the DefaultSelectedItems property instead of Defaults, step1 and step3 are the same.

please put the following formula to DefaultSelectedItems property of combo box:

 

If(Var1,LookUp(Choices('SP list'.Staus),Value="Team Records"),LookUp(Choices('SP list'.Staus),Value="Local Konwledge"))

 

Replace 'SP list' to the Name of SP list.

Annotation 2019-11-06 184436.png

Hope this helps.

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

qfatima
Frequent Visitor

Re: Update to a different dropdown value

Hi @mdevaney  and @v-siky-msft 

 

Thank you for your messages. It is a dropdown value, and also, I realized there's a simpler way to update the value of status (without using any default and hidden variables): 

 

Patch('Bid Management_1', First(Filter('Bid Management_1',Title = EditRecord.Title)),{Status:{Value:"Installation Input"}});

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,888)