# Table component equation uses variable from table

**URL:** <https://cl.desmos.com/t/table-component-equation-uses-variable-from-table/413>\
**Category:** Questions\
**Created:** [March 6, 2019, 8:17am UTC](https://cl.desmos.com/t/table-component-equation-uses-variable-from-table/413 "2019-03-06T08:17:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![keysclan](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@keysclan](https://cl.desmos.com/u/keysclan)\
**Post date:** [March 6, 2019, 8:17am UTC](https://cl.desmos.com/t/table-component-equation-uses-variable-from-table/413/1 "2019-03-06T08:17:56Z")

</div>

I have a table component and a graph. I want one cell in the table to be a variable (s) which takes its value from a variable in the graph component. In the next table cell I want to type an equation (eg y = 3x + s) so the value of s in the graph component can be used in the equation typed into the table.

Help please!

[https://teacher.desmos.com/activitybuilder/custom/5b39d632a4f3817a55d6fae9](https://teacher.desmos.com/activitybuilder/custom/5b39d632a4f3817a55d6fae9)

---

<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:** [March 7, 2019, 6:21am UTC](https://cl.desmos.com/t/table-component-equation-uses-variable-from-table/413/2 "2019-03-07T06:21:16Z")

</div>

You can make s a variable in your function by adding a little to your script:

 ![50%20PM](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/459434074108f44918d1520f928fbf2b0aeaaf60.png)  
you’ll have to add a little bit to your graph as well:  
 ![02%20PM](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/a6fcf77202412d7f338f8aaa6fd2b9ca7d76ab9d.png)

make s equal to your scale factor variable and it should all connect

---

<div class="post-metadata">

**Author:** ![keysclan](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@keysclan](https://cl.desmos.com/u/keysclan)\
**Post date:** [March 7, 2019, 7:27am UTC](https://cl.desmos.com/t/table-component-equation-uses-variable-from-table/413/3 "2019-03-07T07:27:42Z")

</div>

Thanks for replying so quickly Jay! To be clear, I need to add the “x”, “s” bit in my Graph script and change y=h((x) to y=h(x,s) in my Graph?

I’ve set s equal to the scale factor in the Table script:  
s = CaveGraph2.number(“s\_f”)  
cellContent(1,2):“s”

It still doesn’t seem to work - when I add an s into one of the equations in the table (eg from y=2x+13 to y=2x+13/s) the graph disappears… Ami I still missing something, or have I put code in the script of a wrong component?

---

<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:** [March 8, 2019, 1:26am UTC](https://cl.desmos.com/t/table-component-equation-uses-variable-from-table/413/4 "2019-03-08T01:26:47Z")

</div>

Here’s a working copy:

> **[\[Copy of\] AS2.2 The Cave • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5c80b4093b832e350ad6c073)**
>
> by @mrchowmath

There are a few things to consider when entering the functions:

If you want to use your format you’ll need a second variable in there…  
 ![31%20PM](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/6e7d1ee4fb9f92c394ee567d128c67a64c1f6621.png)

…or you could just use y=  
 ![42%20PM](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/d4453091a96431c1068e39669192916192953b58.png)

… or just the expression.  
 ![47%20PM](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/1X/6d3deb04673fd10b60128fdcf6c9b0eabe85ca30.png)

---

<div class="post-metadata">

**Author:** ![keysclan](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@keysclan](https://cl.desmos.com/u/keysclan)\
**Post date:** [March 8, 2019, 7:12am UTC](https://cl.desmos.com/t/table-component-equation-uses-variable-from-table/413/5 "2019-03-08T07:12:57Z")

</div>

It’s always something simple (that makes you feel a bit dumb!). All fixed - thanks so much for your help!
