cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

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!

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
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 (32,845)