cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Update dropdown value based on changes to another field

Hi All,

I have a dropdown value box containing ["Approved","Pending for Approval","Rejected"].

I have another edit datacard named 'Number of Workers'. I would like the dropdown value to update to "Pending for Approval" from any other statuses upon any changes to the editform. How do I achieve this?

Alois_0-1604463547475.png

Regards,
Alois

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @gabibalaban ,

That was one of my possible thoughts as well and the error should show hopefully, however to pre-empt the code possibly should be

If(
   !IsBlank(varStatus),
   {Value:varStatus},
   {Value:ThisItem.Status}
)

View solution in original post

6 REPLIES 6
Super User III
Super User III

Hi @Alois ,

On the OnChange of the Number Of Workers control, put

UpdateContext({varStatus:"Pending for Approval"});
Reset(YourStatusDDName)

On the Default of the drop-down put

If(
   !IsBlank(varStatus),
   varStatus,
   Parent.Default
)

and to clean up on the end of the save code (after SubmitForm) put 

UpdateContext({varStatus:Blank()})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @WarrenBelz ,

I did as above and got the following error. I have tried replacing Parent.Default to ThisItem.Status to no avail.

Alois_0-1604473176124.png


Regards,
Alois

Did you set varStatus on the OnChange of the Text Box? Also, what is the error message?

Hi @WarrenBelz ,

Sorry for interference, but I have a strange feeling that the data source in a SharePoint list and the Status column is in fact a choice type one.  😊 ... It is just a though.

Thanks @gabibalaban ,

That was one of my possible thoughts as well and the error should show hopefully, however to pre-empt the code possibly should be

If(
   !IsBlank(varStatus),
   {Value:varStatus},
   {Value:ThisItem.Status}
)

View solution in original post

Hi @Alois ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (21,303)