cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

How to determine status of non-boolean variable?

Hello. I'm building a little debugging menu into my app and ran into an issue. 

 

I have one variable (varSubdiv) which returns a table of data. In the debugging menu, I want to show "true" or "false" for each variable in my app. However I can't find a way to set a status label Text Property to varSub if it returns a table. 

 

How can I determine the status of a non-boolean variable? 

 

So far I've tried putting the following in the Text Property of of the status label: 

 

varSubdiv

 

and...

 

If(
    varSubdiv,
    "true", "false")

and..

 

If(
    varSubdiv = //the table I'm querying//
        Distinct(
            Filter(
                theTable,
                column = dropdown.Selected.Value),
        returnColumn),
"true","false")

All return some form of the error: "Invalid argument type."

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: How to determine status of non-boolean variable?

For which values of 'varSubdiv' would your debugging menu show true or false? Since that variable is a table, there are some options for that:

  • The table is empty : you can use If(CountRows(varSubdiv) = 0, "true", "false")
  • The table is blank / null : you can use If(IsBlank(varSubdiv), "true", "false")
  • The table is identical to some other table : you can use something like the expression below:
If(
    And(
        CountRows(varSubdiv) = CountRows(otherTable),
        0 = Sum(
            ForAll(
                varSubdiv,
                If(IsBlank(LookUp(otherTable, column = subDivColumn)), 0, 1)),
            Result)),
    "true",
    "false")

Let us know the logic that you're using to determine whether that variable should be shown as true/false, and we should hopefully be able to help you get there!

View solution in original post

2 REPLIES 2
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: How to determine status of non-boolean variable?

For which values of 'varSubdiv' would your debugging menu show true or false? Since that variable is a table, there are some options for that:

  • The table is empty : you can use If(CountRows(varSubdiv) = 0, "true", "false")
  • The table is blank / null : you can use If(IsBlank(varSubdiv), "true", "false")
  • The table is identical to some other table : you can use something like the expression below:
If(
    And(
        CountRows(varSubdiv) = CountRows(otherTable),
        0 = Sum(
            ForAll(
                varSubdiv,
                If(IsBlank(LookUp(otherTable, column = subDivColumn)), 0, 1)),
            Result)),
    "true",
    "false")

Let us know the logic that you're using to determine whether that variable should be shown as true/false, and we should hopefully be able to help you get there!

View solution in original post

Super User
Super User

Re: How to determine status of non-boolean variable?

Thank you @CarlosFigueira, this is the exact logic I needed to understand and get into my head. I'm so used to boolean variables that I was blinded to "true / false" as an only option. 

 

Take care

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 55 members 3,349 guests
Please welcome our newest community members: