# Need help resolving a bug in query as its not returning expected response

**URL:** <https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210>\
**Category:** Ask for Help\
**Created:** [May 9, 2024, 3:48am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210 "2024-05-09T03:48:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [May 9, 2024, 3:48am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/1 "2024-05-09T03:48:36Z")

</div>

Hi Guys,

I have a table called as ExCampaigns where I list all my campaigns. Campaigns have a campaign Owner.

 ![Screenshot 2024-05-09 at 9.08.18 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/5/05de8484d628fcbf59314311b6c305768807587e.jpeg)

In my front end I have a drop down selection to Select campaign owners and when we select them it writes into Ex campaign table under column called “SelectedManager”

 ![Screenshot 2024-05-09 at 9.09.15 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/6/f6abfca4c3560af369ce67920b16f2987437995f.png)

I have a query Running on Table ExCampaign where filter criteria is “CampaignOwner” is “SelectedManager”

 ![Screenshot 2024-05-09 at 9.09.30 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/b/3bd852073b34550bf5383241fa68a91862ee2e01.jpeg)

For Some reason I am not getting Right response though I have Selected Manager present in 7 Places  
\*\*Query response is giving me campaigns with no CampaignOwners in response, All my campaignOwners are present for all campaigns \*\*

 ![Screenshot 2024-05-09 at 9.10.12 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/2/12ef284729d401ec65a676226aa438be80328c62.jpeg)

Is this some bug which is there?

Thank you for your help.

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [May 9, 2024, 3:56am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/2 "2024-05-09T03:56:13Z")

</div>

As shown in my second screenshot. My “SelectedManager” column is a user specific **Text column**

which only writes value to the first cell.

Is that creating any issue?

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![raajkumars](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/raajkumars/32/74046_2.png) [@raajkumars](https://community.glideapps.com/u/raajkumars)\
**Post date:** [May 9, 2024, 4:21am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/3 "2024-05-09T04:21:37Z")

</div>

Am I right in my understanding that both the `CampaignOwner` and `SelectedManager` columns are in the same `Ex-Campaign` table? Also, it appears that your query is actually matching the `CampaignOwner` with the `SelectedManager` column in the same row. Is this right? If so the query result will vary based for each row based on what the value is for `SelectedManager` column in that row.

The problem is you are trying to do too much in the same table. If you are trying to track the list of all campaigns each user owns, then you need a child table that holds the `Campaign ID` and `CampaignOwner` (i.e if there can be more than one campaign owner for a campaign. Otherwise you can put it in the `Ex-Campaign` table itself). Then add a `Campaigns` Relation to the where you have to those campaign owners listed (say `Managers` Table). To sum up, you need a separate `Managers` table where the list of managers are listed and this is where the list of all campaigns owned by each manager should be collected as a relation column.

If you really need to see the list of all campaigns managed by the manager who is managing a campaign, add a lookup column to the `Ex-Campaign` table to pull the `Campaigns` column from the `Managers` table.

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [May 10, 2024, 5:16am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/4 "2024-05-10T05:16:37Z")

</div>

> [@raajkumars](#):
>
> Am I right in my understanding that both the `CampaignOwner` and `SelectedManager` columns are in the same `Ex-Campaign` table?

Yes you are absolutely right .

See what I want to do is in the query it should check the value I have selected from my choice component and then it should give a list of all campaigns where manager is the selected person.

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![raajkumars](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/raajkumars/32/74046_2.png) [@raajkumars](https://community.glideapps.com/u/raajkumars)\
**Post date:** [May 10, 2024, 5:23am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/5 "2024-05-10T05:23:59Z")

</div>

> See what I want to do is in the query it should check the value I have selected from my choice component and then it should give a list of all campaigns where manager is the selected person.

Where do you want to use this list of all campaigns managed by the selected person? On a form inside another dropdown? If so, it won’t work because your selection has not been committed to the table yet. Perhaps if you can show the relevant parts of the UI, we (the community) may be able to suggest some creative solutions.

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [May 10, 2024, 5:33am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/6 "2024-05-10T05:33:31Z")

</div>

I think I got the issue. Since my selected value is only recorded in the first row My query is not working.

As a hack for time being I am writing it as single value now.

I am just wondering how can I make it work When I am writing the selected choice into my campaigns table.?

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [May 10, 2024, 5:36am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/7 "2024-05-10T05:36:03Z")

</div>

Thank you for replying Raaj 🙂

This is my UI where I am having a choice component

 ![Screenshot 2024-05-10 at 11.04.30 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/6/a66d9e30f9dfc17215f8850e55fe01f8682d78da.jpeg)

I am writing the values from this to campaigns table with column name

SelectedManager as shown in the figure above.

Since I am doing this it just records the value in the first column only so my query was not working.

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![raajkumars](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/raajkumars/32/74046_2.png) [@raajkumars](https://community.glideapps.com/u/raajkumars)\
**Post date:** [May 10, 2024, 5:53am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/8 "2024-05-10T05:53:49Z")

</div>

How about replacing the dropdown with a “Assign Manager” button, which when clicked pops up a dialog that allow a manager to selected and submitted? That way, the selection will be committed to the current campaign and then the computed columns will be update automatically.

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [May 10, 2024, 6:05am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/9 "2024-05-10T06:05:32Z")

</div>

Hi Raaj,

My requirement is just to write the selected Manager so that I can use that in my query to list all campaigns assigned to the manager.

Having to do you method would introduce 2-3 extra steps for user right?

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![raajkumars](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/raajkumars/32/74046_2.png) [@raajkumars](https://community.glideapps.com/u/raajkumars)\
**Post date:** [May 10, 2024, 6:14am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/10 "2024-05-10T06:14:45Z")

</div>

yes, what I suggested would require two extra clicks. BTW when you make a selection in your current implementation, is the selection getting setting saved to current campaign row that is being viewed?

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [May 10, 2024, 6:24am UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/11 "2024-05-10T06:24:13Z")

</div>

> [@raajkumars](#):
>
> when you make a selection in your current implementation, is the selection getting setting saved to current campaign row that is being viewed?

Currently it is getting saved to first row of the column with name Selectedmanager

Regards,  
Dilip

---

<div class="post-metadata">

**Author:** ![raajkumars](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/raajkumars/32/74046_2.png) [@raajkumars](https://community.glideapps.com/u/raajkumars)\
**Post date:** [May 10, 2024, 1:37pm UTC](https://community.glideapps.com/t/need-help-resolving-a-bug-in-query-as-its-not-returning-expected-response/73210/12 "2024-05-10T13:37:44Z")

</div>

There should be only row per campaign, right? If so, shouldn’t selected manager for that campaign go into that same row.

The way Glide works is that ui elements are bound to a table or a specific row. So if you are editing the first row of a table, you cannot set or get information from another row in the table directly.
