# I'm stuck trying to create an app that references a database of what people prefer out of two random options

**URL:** <https://community.thunkable.com/t/im-stuck-trying-to-create-an-app-that-references-a-database-of-what-people-prefer-out-of-two-random-options/2394334>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [April 28, 2023, 4:03am UTC](https://community.thunkable.com/t/im-stuck-trying-to-create-an-app-that-references-a-database-of-what-people-prefer-out-of-two-random-options/2394334 "2023-04-28T04:03:32Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![rosstaylor1b96fv3](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rosstaylor1b96fv3](https://community.thunkable.com/u/rosstaylor1b96fv3)\
**Post date:** [May 11, 2023, 4:48am UTC](https://community.thunkable.com/t/im-stuck-trying-to-create-an-app-that-references-a-database-of-what-people-prefer-out-of-two-random-options/2394334/21 "2023-05-11T04:48:33Z")

</div>

Hi @ioannis . Thanks once more for your help. This response is a bit lengthy, but wanted to explain the behaviours as I’m seeing now. (This is from starting with no existing records in the Combinations1 table):

 ![20230508b](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/8/88479a8f9638b089477f4fe1ef5b664ec16dba25.png)

 ![ThisOrThat](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/d/6d58844ca09f6b49a5752e647936392f4ae57a7e.png)

 ![Combinations1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/3/b3150092aea08632552e5c968ce98be98722402b.png)

**When screen 1 opens:**

- Everything looks OK
- I get a random item for Option A and a random item for Option B appearing as text in the OptionA and OptionB buttons

**When I click OptionA button:**

- The table in Combinations1 updates correctly - a record is created with the correct OptionA and Option B and 1 is added to the VotesForA field, and the PercentA and PercentB fields update
- The labels do not update - the label text should be appearing now as the text in the PercentA (100) and PercentB (0) fields, but nothing is displayed

**Click Option A again (same 2 options on screen as before)**

- The table updates correctly i.e. VotesForA updates to “2”
- The labels update correctly too - LabelA text shows as 100 and LabelB text shows as 0

**If I click Option A button again (still same 2 options as before)**

- Nothing happens - table record does not update

**Click Option B (same 2 options as before still on screen)**

- Table updates correctly - 1 added to VotesForB, PercentA and PercentB fields also update
- Label text does not change (it should change to the new PercentA and PercentB values)

**If I click Option B again (same 2 options as before)**

- Nothings happens - table fields do not update

**If I now click “Another”**

- Gets 2 new random items for Option A and Option B as it should, and shows these as the text in the OptionA and OptionB buttons
- The label text stays on screen from the time before I pressed “Another”. I would want this to reset when “Another” is clicked

**Click Option A button**

- Table updates correctly - two new items are added in a new row and the VotesForA field updates to “1”
- The label texts disappear where I want them to now show the PercentA and PercentB values for the new row

**Click Option B button (same 2 options)**

- Table updates correctly, so now shows VotesForA=1, VotesForB=1, PercentA=50, PercentB=50
- Label texts also update correctly - shows LabelA text as 50 and LabelB text as 50

**Click Option A again (same items)**

- Table updates OK - VotesForA=2, VotesForB=1, PercentA=67, PercentB=33
- Labels on screen do not update though

**Click “Another” and get 2 options that are already an existing combination in the Combinations1 source**

**Click Option A**

- Nothing happens - no records update

**Click Option B**

- Table updates OK - correct existing records update

**Try clicking Option A again**

- Creates a new entry in table with a different (incorrect) Option A but the correct Option B - it should not create a new record line at all as the combination already exists

**Click Option B**

- Table updates correct Option B but wrong Option A existing combination

**Click Option B again**

- Updates table with new record containing both wrong Option A and wrong Option B

---

<div class="post-metadata">

**Author:** ![rosstaylor1b96fv3](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rosstaylor1b96fv3](https://community.thunkable.com/u/rosstaylor1b96fv3)\
**Post date:** [May 11, 2023, 4:52am UTC](https://community.thunkable.com/t/im-stuck-trying-to-create-an-app-that-references-a-database-of-what-people-prefer-out-of-two-random-options/2394334/22 "2023-05-11T04:52:51Z")

</div>

Here are the blocks that I’m using with the behaviours described in the previous message

 ![20230511a](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/c/5c55afcd1e735c622c9bc3f182c1c9864c668a67.png)

 ![20230511b](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/f/7fff78def578fa1b67fb4219c9674c1289af0810.png)

 ![20230511c](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/e/be6fdcc1fd717b31822dfbb0ef2ba4da43910b00.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 9, 2023, 4:53am UTC](https://community.thunkable.com/t/im-stuck-trying-to-create-an-app-that-references-a-database-of-what-people-prefer-out-of-two-random-options/2394334/23 "2023-08-09T04:53:47Z")

</div>

Closed on August 9, 2023, 4:53am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.thunkable.com/t/im-stuck-trying-to-create-an-app-that-references-a-database-of-what-people-prefer-out-of-two-random-options/2394334.md?page=1)
