cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
qfatima
Level: Powered On

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
Level: Powered On

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
mdevaney
Level 8

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."

v-siky-msft
Level 10

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
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 140 members 5,266 guests
Please welcome our newest community members: