How to prevent circularReference when fill a or b from data in a or b

Hi there!
I’m trying to create a sheet where A fills in information from B. Or if B is filled in, the A pulls data from B.
This works fine after I edit the fields, but it looks wrong until I have…
I’m using this for a sportsbetting tracker where I can either fill in Units or Bet amount, and it will fill in the other one for me.
If I have set Balance to $100, and Unit size to 5%
then when I fill in bet size (B) as $5 then it should fill in Unit size (A) with 1
Or if I fill in Unit Size (A) with 1, then it should fill in Bet size (B) with $5.

Here is an example sheet to showcase what I mean.

How do I prevent the CircularRef that happens until I fill in 1 or the 2?
I tried to prevent it by checking if it’s equal to None, but clearly it’s not equal to None on Creation.

Thank you in advance.

The special PEEK() function exists just for this! Function reference - Grist Help Center

Here’s a version of your document with these two trigger formulas adjusted to work the way that I think you are going for:

This is exactly what I was after, thank you so much! :slight_smile:

1 Like