# Test for Undefined OR empty/unanswered Table Value (Linear Combo Systems)

**URL:** <https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364>\
**Category:** Questions\
**Created:** [January 23, 2019, 6:22pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364 "2019-01-23T18:22:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [January 23, 2019, 6:22pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/1 "2019-01-23T18:22:50Z")

</div>

tl;dr Students enter 2 values into a table. How do I test to see if the tablevalue is empty/undefined?

I still have a way to go, fixing spacing, directions, etc.

Students will be given a system of 2 equations. Their goal is to select the value that needs to be multiplied by the 1st and 2nd equations so that when we add the equations, one of the variables is canceled out.

In the graph area, you’ll see that I am using labels of points to show the equations. I have the 2 original equations. Then I repeat the 2 equations with (m\_a) and (m\_b) to show the multiplication.  
m\_a & m\_b are defined by the values students type into the table.

But if they haven’t typed into the table, the equations are showing m\_a & m\_b as “undefined”. In the CL area for the graph, I’m trying to check for undefined. If m\_a is undefined, I want a variable d\_a to equal 0. If m\_a is defined, I want d\_a to be 1. But d\_a is equalling 1 even when m\_a is not defined.

I’d prefer the value of d\_a to update even if students haven’t yet clicked submit.

Maybe there’s a better way to accomplish this instead of using d\_a? My thoughts were that I’d create two equations:  
\*\*if m\_a is undefined, put (?) at the front and end.  
\*\*if m\_a is defined, put the value of m\_a at the front and end.

[Linear Systems CL](https://teacher.desmos.com/activitybuilder/custom/5c48ab4717ee450bc4820239)

(EDIT: Moved to Questions instead of discussion)

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [January 23, 2019, 10:14pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/2 "2019-01-23T22:14:59Z")

</div>

You can test any input to see if it is blank using isBlank(input goes here) or if it has been filled using not(isBlank(input goes here))

You can also use firstDefinedValue in some of these situations to give a value of 0 (or whatever you want) when another is undefined

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [January 23, 2019, 10:22pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/3 "2019-01-23T22:22:53Z")

</div>

Thanks Jay,  
I’ve tried the codes below, but I’m still getting 1 even if nothing has been entered into the table.

bounds:  
makeBounds(-7,7,-7,7).setStrategy(top())  
number(“m\_a”): table1.cellNumericValue(1,2)  
number(“m\_b”): table1.cellNumericValue(2,2)

number(“d\_a”):  
when isUndefined(“m\_a”) 0  
otherwise 1

number(“d\_b”):  
when isBlank(“m\_b”) 0  
otherwise 1

Note in the first line of the graph, ma=undefined but da=1 and db=1.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/1114456e520b274b8e6e09e7b4a8443a3f510787.png)

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [January 23, 2019, 10:26pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/4 "2019-01-23T22:26:34Z")

</div>

Ahh got it. You want isUndefined(number(“m\_a”))

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [January 24, 2019, 3:24pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/5 "2019-01-24T15:24:17Z")

</div>

Now I get an error warning: Unknown function “number”  
 ![CL%20undefined2](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/d1383d63faec978a4ed386a851b6f6a39c5ee9b1.png)

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [January 24, 2019, 3:32pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/6 "2019-01-24T15:32:24Z")

</div>

Sorry, should’ve been clearer. If you’re gonna use number as a source you need a source component. So all together you’d have isUndefined(this.number(“m\_a”)). “this” assuming everything is in the same component. If you’re looking up a number in a different component you’ll need to reference that component.

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [January 24, 2019, 5:36pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/7 "2019-01-24T17:36:36Z")

</div>

Thank you that worked!  
Lesson learned. Even for local variables in the CL, I can’t call **“m\_a”** I need to call **this.number(“m\_a”)** whenever i want to do anything with that.  
Now it’s working!  
 ![CL%20undefined3](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/6cca9bce19aab4eb24538ab0bedf57d44fadc39e.png)

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [January 24, 2019, 5:48pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/8 "2019-01-24T17:48:57Z")

</div>

If you don’t actually need it to be a number in the calculator you can just make it m\_a = … and then you won’t need to define it as a number in the next section. But yes, if you are defining it as a number in the calculator you need to call on it as such.

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [March 22, 2025, 6:50pm UTC](https://cl.desmos.com/t/test-for-undefined-or-empty-unanswered-table-value-linear-combo-systems/364/9 "2025-03-22T18:50:05Z")

</div>

Hi all. Here’s an updated link for the activity we were discussing in case you want to see the final product.  
It’s created so you could reuse the slides by changing the values in the equations and the solutions to create additional examples.

> **[\[Sharing\] Systems: Linear Combo • Activity Builder by Desmos Classroom](https://teacher.desmos.com/activitybuilder/custom/5dd2faf754f6fc0c24738b6c?utm_campaign=share&utm_content=activity)**
>
> by Amber M. Smith, CFISD Curriculum Coach
