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

Changing the value of a choice field

I try to customize a form that is based on a sharepoint list.

In that form the choice field "SP_Status" get's the default selected value from a variable called "varStatus":

2019-01-13 17_41_21-Window.png

 

I can already set a default selected value for the field:

2019-01-13 17_36_43-Window.png

 

The problem for me is is to change the value of the field "SP_Status", based on other events.

For instance, if the field "SP_AssignedTo" is set, the field "SP_Status" shall automatically change to "02 - In Process (Manufacturer)"

The field "SP_AssignedTo" is a person field and I tried to implemend my update rule as follows:

2019-01-13 17_59_21-Window.png

 

 

If(Not(IsEmpty(DataCardValue21.Selected.DisplayName)), //If current field != Null...
Set(varStatus,{ Value:  "02 - In Process (Manufacturer)" }), //...set varStatus to "02.."
Set(varStatus, { Value:  "01 - Inquiry" })) //else, set varStatus to "01.."

 

 

My thinking is, that the OnChange-Event will update the value of the variable "varStatus" and the default selected value in the field "SP_Status" will be update based on the input of the variable.

 

In fact my rule is working somehow, but not as expected:

If I open an item in view mode I get the following information:

2019-01-13 18_15_38-Window.png

 

In view mode the field "SP_Status" is empty, but on the left side you can see that the status of the column "SP_Status" is "01 - Inquiry".

 

When I now open the form in edit mode, the field "SP_Status" is still empty. I expect that the value is "01 - Inquiry".

When I update the field "SP_AssignedTo" the field "SP_Status" will be updated. That's fine.

Corresponding to above rule I expect that the value of the field "SP_AssignedTo" will again be updated to "01 - Inquiry", if I delete the value of "SP_AssignedTo",  but in fact nothing happens in my tests.

 

What do I have to do, to make above scenario work?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate IV
Advocate IV

@sakleboe,

I believe your setting varStatus based on null or not od assigned to value is working.

 

I am showing you why your edit/view views are not showing the existing value.

1. Set the default property of SP_Status to varStatus

2. you have set the default value foe NEW property of SharePointIntegration and didn't set for the VIEW and EDIT form. So, your edit and view is not showing the correct one. It should be:

 

 

View solution in original post

3 REPLIES 3
Highlighted
Advocate IV
Advocate IV

@sakleboe,

I believe your setting varStatus based on null or not od assigned to value is working.

 

I am showing you why your edit/view views are not showing the existing value.

1. Set the default property of SP_Status to varStatus

2. you have set the default value foe NEW property of SharePointIntegration and didn't set for the VIEW and EDIT form. So, your edit and view is not showing the correct one. It should be:

 

 

View solution in original post

Highlighted

Hi @pNabin,

 

It was not completely clear for me, how the choice field works.

 

Now I got some interesting input.

 

Thank's for your help!

Highlighted

Hi @sakleboe,

On of the resource I would recommend is @Shanescows youtube tutorial on Combobox. He has simplified combox and has different tips and tricks on it. PoweApps Combobox - Search, Filter, Default values, and more

 

-Nabin

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,467)