Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Getting the right columns with a simple IF statement (10 users trying and still can´t do it)

Hi PowerPros,

I have a table with 2 columns, and i want to populate a listbox with 1 of the 2 columns, depending on the value entered in the textbox.


The two columns are named ".RegraFranquia1" and ".RegraFranquia2."


The Textbox of the value is called "TextInputCapitalSeguro.Text"


Please se image atached for the warning. How can i get the right column?





Frequent Visitor

Looks like the formatting of the If condition is not right. I have seen the similar issue with If usage. Please refer to this blog

Let me know if this helps or not. 

Super User
Super User

Hi @Ulisses ,

I free-type this, so mind the brackets and commas, but selection controls do not always like variable content

            vSelected >= 7500 && vSelected < 15000,
            vSelected >= 15000,


Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Community Support
Community Support

Hi @Ulisses :

It seems that RegraFranquia1 and RegraFranquia2 are neither text type nor number type.

Could you tell me what type of fields they are?

Best Regards,


Hello @WarrenBelz Thank for your time and help.


 I am getting the error, please see attached image. I am using the code in a listbox.


Hi @Ulisses :

Could you tell me what RegraFranquia1 and RegraFranquia2's data types are?

I did a  test, when RegraFranquia1 and RegraFranquia2 are numeric or text types, no error is reported.

Best Regards,




Hi @v-bofeng-msft , thank you for your help. Numeric. 

Hi @Ulisses :

I suggest you check the value of TextImputCapitalSeguro.Text
If it is empty or less than 7500 or cannot be formatted as a number, then the error will also appear.


Best Regards,


@Ulisses ,

That was also an issue I was going to raise (values under 7500 were not catered for). Also I assume with your choice if fields, you were not looking for a table.

I can help you with this, but please tag whoever you want to continue with here as three-way conversations just confuse everyone.


Helpful resources

2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,728)