What is a Lexar error and how do you resolve it?

Can someone explain to me what a Lexar error is and how to resolve it?

image

Can you please paste the code of the whole expression which is giving you this error?

{{(sc_ad_job_q.data.sa_ad_job_q.driv_rep_status == null) ? '[Repair Category: not selected in tab 9]' : (sc_menus.data.q_menus.where('menu_list_id', sc_menus.data.q_menus.where('menu_list_id', sc_ad_job_q.data.sa_ad_job_q.driv_rep_status, '==')[0].list_ref, '==')[0].list_label)}}

You have a bound value using this expression but the expression isn’t valid:
image

This bit doesn’t look right

Can you try it without the square brackets?

{{(sc_ad_job_q.data.sa_ad_job_q.driv_rep_status == null) ? 'Repair Category: not selected in tab 9' : (sc_menus.data.q_menus.where('menu_list_id', sc_menus.data.q_menus.where('menu_list_id', sc_ad_job_q.data.sa_ad_job_q.driv_rep_status, '==')[0].list_ref, '==')[0].list_label)}}

I get the same error

image

Same error if I take the colon out as well.

Where is this on a page? In a dmx-bind/dmx-text or just placed on the page?
Can you share the surrounding code?

Just placed on a page inside div’s and p’s.

Weird. Obviously it will always resolve as null for me and only return the first ternary statement but it seems valid:
image

Does it work when published? It looks like this is when you’re trying to open the data binding window in the UI

you could also try without the brackets on the ternary statements, there’s no need for them as there’s no order of processing you need to enforce:

{{sc_ad_job_q.data.sa_ad_job_q.driv_rep_status == null ? 'Repair Category: not selected in tab 9' : sc_menus.data.q_menus.where('menu_list_id', sc_menus.data.q_menus.where('menu_list_id', sc_ad_job_q.data.sa_ad_job_q.driv_rep_status, '==')[0].list_ref, '==')[0].list_label}}

Yes, it works when published.
Yes, it is when trying to open the data binding window in the UI.
I tried without brackets and still the same error.

Strangely, if I remove any spaces and the colon from the text as indicated, it works without giving an error.

{{(sc_ad_job_q.data.sa_ad_job_q.driv_rep_status == null) ? '[RepairCategorynotselectedintab9]' : (sc_menus.data.q_menus.where('menu_list_id', sc_menus.data.q_menus.where('menu_list_id', sc_ad_job_q.data.sa_ad_job_q.driv_rep_status, '==')[0].list_ref, '==')[0].list_label)}}

Can you try adding it as dmx-text in the span?:
i.e.

<span dmx-text="sc_ad_job_q.data.sa_ad_job_q.driv_rep_status == null ? 'Repair Category not selected in tab 9' : sc_menus.data.q_menus.where('menu_list_id', sc_menus.data.q_menus.where('menu_list_id', sc_ad_job_q.data.sa_ad_job_q.driv_rep_status, '==')[0].list_ref, '==')[0].list_label"></span>

Then try opening the expression under dynamic attributes for the span (you’ll have to switch to DOM mode in the App Structure panel to see the Dynamic Attributes option for a span element)

I tried the same expression on my computer (Mac M1 W4.2.2) and the picker opened fine. Maybe OS specific??

Unfortunately same error :frowning:

That is just an UI error, the code should be working perfectly fine. We will check this.

1 Like

I am still struggling with this.
This may just be a UI error but it won’t allow me to accept it and move on. It returns me to the Data Formats menu. If I click ‘Select’ again I get the error message. etc etc