cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Switch, Incompatible Type Error

I am having trouble with determining the source of an error.

 

I have a Radio control with this items property.

 

radiocontrol.png

 

In the OnSelect I have a switch statement that is throwing an 'Incompatible Type' error and I can't figure out where it's coming from.

incompatibletypeerror.png

The variables match what is in the switch statement and I have checked all other references to the Radio Control to make sure that they are referencing the correct values.

 

variables.png

 

Any suggestions of where to look would be most welcome.

 

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
1 ACCEPTED SOLUTION

Accepted Solutions
Alex_10
Super User
Super User

@JR-BejeweledOne 

haven't seen that error before. but noticed extra comma in your switch statement in the last condition code line.

also, personally i would try to get radio selected values in a single consistent way: radio.selected.value (in your code there are 2 ways are used - radio.selected.value and radio.selectedtext.value).

as i remember .selectedtext is deprecated. may be that causes that errors.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @JR-BejeweledOne ,

Can you please post that code also in a text box so I can have a good look at it.

Alex_10
Super User
Super User

@JR-BejeweledOne 

haven't seen that error before. but noticed extra comma in your switch statement in the last condition code line.

also, personally i would try to get radio selected values in a single consistent way: radio.selected.value (in your code there are 2 ways are used - radio.selected.value and radio.selectedtext.value).

as i remember .selectedtext is deprecated. may be that causes that errors.

As Alex indicated below, there is an extra comma.   Sometimes it takes an extra set of eyes!.   But, yes, here.

Switch(
      RadioReplaceDeveloperQuestion.SelectedText.Value,

       "Replace Developer",  SubmitForm(FormTrainingContent); SubmitForm(FormCumulativeProjects),

       "Change my selections", UpdateContext({ DeveloperValidation: false }),

       "Update hours for assigned developer", UpdateContext({DevName: ComboBoxDevelopers.Selected.Name}); SubmitForm(FormTrainingContent); SubmitForm(FormCumulativeProjects),

       "Update hours for assigned collaborator", UpdateContext({DevName: ComboBoxDevelopers.Selected.Name}); SubmitForm(FormTrainingContent); SubmitForm(FormCumulativeProjects),



)

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Sometimes it takes an extra set of eyes, especially at the end of the day.   I didn't know that SelectedText was deprecated.  Thanks for pointing that out.

 

It was indeed the extra comma.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,055)