# Vision client won't load template repeater but the designer will

**URL:** <https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565>\
**Category:** Ignition\
**Tags:** vision, ignition80\
**Created:** [August 30, 2023, 4:21pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565 "2023-08-30T16:21:09Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 30, 2023, 4:21pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/1 "2023-08-30T16:21:09Z")

</div>

I have a project that loads work order templates into a template repeater limited to max of 100. The repeater will load in the designer but when I open the same window in the client it will not. It is also worth noting that the same repeater will load on some computers in the client while not at all on others, like mine.

The template has 15 parameters to fill in the location, status, colors, etc. I supply the template params via a single query from our database shown below.  
On the computers that work it takes a few seconds to load but does load. Mine can be left for 30 mins without loading anything.

Originally I thought it was the query performance causing loading issues but that doesn't make sense given the difference of client vs designer on my computer. I then thought it was a rendering issue and the computer being fast enough but again client/designer difference throw that out.

I'm at a loss for why this is happening. Any ideas?

### param query

```sql
SELECT 
  * 
FROM 
  (
    SELECT 
      r.id as "id", 
      e.Name as "Requester", 
      title as "Title", 
      detail as "Detail", 
      `timestamp` as "Submitted", 
      a.tag as "Area", 
      a.id as "aId", 
      a.color as "AreaColor", 
      r.priority as "PriorityId", 
      p.color as "PriorityColor", 
      p.tag as "Priority", 
      r.top as "top", 
      r.images as "images", 
      CONCAT(
        "R", 
        LPAD(r.id, 4, "0")
      ) as "rId", 
      r.clockNumber as "ClockNumber" 
    From 
      Requests r 
      JOIN ShopOrderData.Employees e ON r.clockNumber = e.ClockID 
      JOIN Area a ON a.id = r.area 
      JOIN Priority p ON p.id = r.priority
  ) as request 
  JOIN (
    SELECT 
      rh.requestId, 
      s.id as "StatusId", 
      s.status as "Status", 
      s.color as "StatusColor", 
      rh.id as rhId 
    From 
      RequestHistory rh 
      JOIN Status s ON s.id = rh.statusId 
    WHERE 
      rh.id IN (
        SELECT 
          MAX(id) 
        From 
          RequestHistory 
        Group By 
          requestId
      )
  ) AS history ON request.id = history.requestId
  LEFT JOIN (
    SELECT 
      eqc.reqid, 
      eqc.equipment as "Equipment" 
    FROM 
      Equipment_conn eqc
  ) equip ON equip.reqid = request.id 
  LEFT JOIN (
    SELECT 
      eq.equipment, 
      eq.description as "EquipmentDesc" 
    FROM 
      Equipment eq
  ) equipd ON equipd.equipment = SUBSTRING_INDEX(
    SUBSTRING_INDEX(
      SUBSTRING_INDEX(equip.equipment, '"', 2), 
      '"', 
      -1
    ), 
    ',', 
    -1
  ) 
WHERE 
  (
    SELECT 
    IF("{searchString}" = "ALL",
    	TRUE,
        ClockNumber = CAST('{searchString}' AS SIGNED) 
        OR Requester LIKE '%{searchString}%' 
        OR Title LIKE '%{searchString}%' 
        OR CONCAT(Requester, Title) LIKE '%{searchString}%' 
        OR id = :partToRequest 
        OR CONCAT(
          "R", 
          LPAD(id, 4, "0")
        ) LIKE '%{searchString}%'
        OR equip.equipment LIKE '%{searchString}%' 
        OR equipd.EquipmentDesc LIKE '%{searchString}%'
	  )
  )
  AND history.StatusId in {statusFilter} 
  AND IF(
    :AreaFilter > 0, 
    (aId = :AreaFilter), 
    True
  ) 
  AND IF(
    :hideCompleted, 
    (Status != 'COMPLETE'), 
    True
  )
ORDER BY 
  request.id DESC
LIMIT 100

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 30, 2023, 4:22pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/2 "2023-08-30T16:22:45Z")

</div>

Any errors in the client console? Help -\> Diagnostics, or Ctrl + Shift + F7.

---

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 30, 2023, 4:26pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/3 "2023-08-30T16:26:27Z")

</div>

None that show up when navigating to the window.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 30, 2023, 4:36pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/4 "2023-08-30T16:36:48Z")

</div>

> [@Ben\_Hunt](#):
>
> ```auto
> ClockNumber = CAST('{searchString}' AS SIGNED) 
> OR Requester LIKE '%{searchString}%' 
> OR Title LIKE '%{searchString}%' 
> OR CONCAT(Requester, Title) LIKE '%{searchString}%' 
> OR id = :partToRequest 
> OR CONCAT(
> "R", 
> LPAD(id, 4, "0")
> ) LIKE '%{searchString}%'
> OR equip.equipment LIKE '%{searchString}%' 
> OR equipd.EquipmentDesc LIKE '%{searchString}%'
> 
> ```

Are you 100% sure it's not query performance? This part right here is going to be bad for performance and unindexable. Have you run this query through the query explainer or got any metrics on average time it takes? As far as I can tell it will need to do full scans (the worst for perfomance) on each of these columns for this where clause.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 30, 2023, 4:37pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/5 "2023-08-30T16:37:41Z")

</div>

Well, you could do stuff like prove the templates are loading by decorating them with property change scripts that log/print, and verify those in the console. Or try a bisecting approach - duplicate the problematic template repeater onto a test window, see if it works there; try restricting the query to return less rows or otherwise filtering to see if you can hit a critical threshold; try displaying a single instance of the template with hardcoded or semi-hardcoded data on a template window, etc.

---

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 30, 2023, 4:50pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/6 "2023-08-30T16:50:46Z")

</div>

I'm not 100% sure, but I did have my suspicions about that segment. Although when I look in the designer I can view the dataset returned in the vision property editor but the repeater still loads. Worth taking a look at though. Thanks.

---

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 30, 2023, 4:51pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/7 "2023-08-30T16:51:47Z")

</div>

Ok good idea thanks for the pointers.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 30, 2023, 5:40pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/8 "2023-08-30T17:40:26Z")

</div>

If you are using MySQL, run this query in workbench then click on Query-\>Explain Current statement and post results. Also, note how long it takes. I wonder if in designer the results are cached at all on the window.

---

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 30, 2023, 6:07pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/9 "2023-08-30T18:07:27Z")

</div>

I used phpMyAdmin to get this but it should be the same as the workbench.

If the search query = '%%' then it runs with time 0.45 s.  
and explainging results in this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/c/4c27bb6d7aadc872402b0df9058220162a893623.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 30, 2023, 6:10pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/10 "2023-08-30T18:10:14Z")

</div>

> [@Ben\_Hunt](#):
>
> If the search query = '%%'

This is always going to evaluate to true. Put something in there and see how long it takes. Use a string someone would realistically use in your application.

---

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 30, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/11 "2023-08-30T18:13:15Z")

</div>

I tried "Hunter" and got 0.3 s

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 30, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/12 "2023-08-30T18:13:33Z")

</div>

Alright, good enough for me I would not consider the query any further then.

---

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 30, 2023, 8:03pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/13 "2023-08-30T20:03:29Z")

</div>

Well If I move the repeater to its own window it loads normally, so there are some strange interactions going on in my original window that is causing the problem.

---

<div class="post-metadata">

**Author:** ![Ben\_Hunt](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@Ben\_Hunt](https://forum.inductiveautomation.com/u/Ben_Hunt)\
**Post date:** [August 31, 2023, 8:51pm UTC](https://forum.inductiveautomation.com/t/vision-client-wont-load-template-repeater-but-the-designer-will/78565/14 "2023-08-31T20:51:26Z")

</div>

> [@Very slow load time on page displaying large Template repeater](https://forum.inductiveautomation.com/t/very-slow-load-time-on-page-displaying-large-template-repeater/22685/6):
>
> Before you rip your template apart, try adding a dummy Tag Change Script under Client Events that subscribes to all of those tags. The script would do nothing, but tag listeners would be established at client startup that would keep those tags current in the client all of the time. Your window should then open much faster.

I was binding to a tag in my window, once I made a dummy listener for it in the Client Events suggested above it fixed the loading issues of the repeater .
