cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdm4ai
New Member

Canvas app - Set an option list for a field based on a value select in a different field

I should be able to set a option set field on my Canvas app based on a onChange in a different option set field but after trying a few different ways I have had no success. I am sure it has to be simple and I am just getting syntax wrong. Any help would be greatly appreciated. I have attached a screen shot.

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you very much for your reply and help.

 

I used this and it seems to be working. Still doing a little testing.

 

If(!IsEmpty(DataCardValue16.SelectedItems.Value),If(Text(DataCardValue16.Selected.Value)="SMS/Text",
Set(varPhoneType,{Value:"Mobile"}),Set(varPhoneType,{Value:""})))

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @mdm4ai :

Do you want to populate the picklist depend on the selection in combobox1?

Could tell me what the Picklist is?A combobox?A drop down control?

Could tell me what the Picklist 's items property is?

I assume the Pickelist is a drop down control and it's items property is [true,false].

Firstly,let me explain why you can't user the code to change the selection in the Picklist.

After executing the event in OnChange, no value is passed.The key is to pass its value to Picklist.

Secondly,I sugget you try this method.

set the combobox1's OnChange property to:

 

Reset(Picklist)

 

set the Picklist's Default property to:

 

!(IsEmpty(XXXX)) && !(Text(XXXX)="E-Mail")&& (Text(XXXX)="SMS/Text")

 

If the problem cannot be solved, could you provide a more detailed introduction?

Best Regards,

Bof

Thank you very much for your reply and help.

 

I used this and it seems to be working. Still doing a little testing.

 

If(!IsEmpty(DataCardValue16.SelectedItems.Value),If(Text(DataCardValue16.Selected.Value)="SMS/Text",
Set(varPhoneType,{Value:"Mobile"}),Set(varPhoneType,{Value:""})))

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,127)