I’m trying to access a subtable’s value from inside a repeat children, but not having any luck. Is this not allowed, and how does one go about doing this legally?
What I’m trying to achieve.
I’m wanting to apply a different style based the on the condition;
“does X value exist in repeat’s subtable”
Repeat children.
I’m repeating a Table called “projects” The table has a subtable called “stage_1”
I’m wanting to check if a given talent_id exist in the repeat’s stage_1 subtable.
Comparing against subtable.
This is how I normally do it, which works if I’m comparing against the parent table, or the repeat’s datasource is the subtable directly. But pulling out the values in Data Formats, no values exist when choosing property.
I’m doing a similar thing here, just to show the full Data formats (since in the example above it’s incomplete due to the missing property).
EDIT: forgot to mention that the subtable is a LEFT join if that has any bearing on a solution.
Side note - thanks for sharing the full data format example - got me through a long day of trial and error to accomplish this
No problem, let me know if you figure out how to access a subtable using values > property. 
Mine neither…
While using a Repeat Children the UI doesn’t give the list to select and bind.
But in a tableRepeat (dmx-generator=“bs5table”) it’s OK.
I don’t know if we are doing something wrong but anyway YOU CAN HAND CODE THE CONDITION and it will work fine.
I actually tried that when I first ran into the issue, like so;
stage_1.values(talent_id).contains(conn_layout_single_talent.data.query.talent_id)
But it didn’t work unfortunately.
You forgot to enclose the property name in quotation marks
stage_1.values(‘talent_id’).contains(conn_layout_single_talent.data.query.talent_id)
still no dice unfortunately. I wasn’t sure about the formatting and enclosing it in ’ ’ is the default output when I just simple type talent_id
in the property field. So I assumed enclosing it makes it read as text rather than data?
like this
Removing the quotation marks makes the visual formatting seem more correct, so I tried that as well, but neither worked.
like this
I am sure it works…
I don’t know if you are hand coding inside the UI binding panel or in you page code view…
This quotation marks are translated in backquotes in page code view:
Can you please paste your repeatChildren code here and a screenshot of its expression (make sure to expand the subtable)
My application is to show a form inside a display block when the boat_id’s exists in two serverconnect database queries.
It look like you are checking if the “boat_id” field/column of your scUserActiveBookmarks.data.qryBookmark query contains the value of boat_id … I can’t understand from what I see if this boat_id is the field/column of the other servereconnect value you want to check… If you know that this is the field indeed, then the condition looks good.
This boat_id iyou picked it from inside the UI or hand coded it?
- Check if these two field have values before you compare them (in order to be sure if the output -show or not)- is correct)
-
Just check if you need to put your form in a conditional region (not render at all) instead of using the dmx-show attribute (just hide it form view, display:none)
You are correct Fam…
boat_id is a field in two query results. If they match then show.
I did not use a conditional region, used the dynamic show attribute to the display block holding the forrn. I guess I didn’t fully understand the value of the conditional region not showing.
In this case the form consists of a single field clearing or adding a value to the bookmark table. Not rendering very much.
So… It works for you? Is the dmx-show function as it should?
Yes, and I did not hand. I used the data formatter.
Step 1. Choose my array
Step 2. Added the Values, updated Property using the boat_id in the array.
Step 3. Clicked on the array again and then added the Contains, updated Property with boat_id from the other results (in my case a larger repeat table)
Now, I trying to get the buttons to switch when the data changes.
1 Like
Glad it work for you!
If you need help/suggestions “ring the bell” 
hmm yeah odd. I think we’re doing the same thing but getting different results here. I’m doing data.query.data but I don’ think that should matter. It’s a paged query, but I did try it as a multiple query as well.
I also hardcoded a value I know exist in the table, just to make sure that there’s not something wrong with the single_talent query. Which is also why the project ID is displayed in the dmx-text.
Hey @twinklemagoo,
The dmx-class:dropdown-item-disabled
is a custom class you created?
I suppose no, so just leave the dmx-class:disabled
and it will be fine
Hey @famousmag
Indeed, I’m using a custom class here dmx-class:dropdown-item-disabled
. I’m doing some extra things on the disabled state that isn’t part of the default disabled
class.
However, that doesn’t seem to have any effect at all on it working or not. And I’m able to give it any other condition, e.g. stage_1.hasItems()
and the class works as intended.
The problem really seem to come down to it not being able to find the field talent_id
in the subtable stage_1
.
So this all makes me wonder if this is in fact all working, and I’ve simply messed up my initial query in some way. I’ll dig into that a little later today.
Hey @twinklemagoo,
Sorry for this but… I KNOW IT WORKS, I tested it!!!
But I would follow these steps:
- make sure (dev tools, console whatever…) that the talent_id value exists and should meet the condition and so your dmx_class get true.
- leave the custom class aside and use the standard class, the
dmx-class="disabled"
in order to be sure that it is working. If it works, then you work on your custom class.
Hope you get the solution on this fast my friend so you can go on
Haha I trust you brother. I’m clearly doing something wrong on my end, just difficult to figure out what exactly.
One thing I noticed now is that if you type talent_id
into the property field;
the ’ ’ is not translated into
in the code view as you mentioned. So what I’ve been doing here is manually replacing that in the code. Not sure if that could have something to do with it?
How is your DB query structured, are you using any joins at all?