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 III
Super User III

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.

View solution in original post

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,626)