Problem with getting first image from list of images

Hey guys,

So I have a table, and the table has a nested table to add images.
I want to take the first related image and use it as the background in the detail view of the main form.

I have acreated a virtual column and have set that as the main image.

The virtual columns formula is this:

`any(TOP(SELECT(Maintenance Images[Image], ([ID] = [_THIS].[id]), FALSE), 1))`

Note, this expression could significantly impact sync time.

One randomly chosen value from this list (
…TOP(
…The list of values of column ‘Image’
…from rows of table ‘MAINTENANCE IMAGES’
…where this condition is true: ((The value of column ‘ID’) is equal to (The value of ‘ID’ from the row referenced by ‘Repair Image Detail’))
…1))

This does not seem to return a image, Am I doing something wrong?

Any help would be splendid,

Stay Safe,

I assume your table has a ref_rows virtual column “Related Maintenance Images”?

You can greatly simplify your expression by using that.

Also, ANY(TOP(…,1)) is pretty much equivalent to INDEX(…,1)

So, this should work:

INDEX([Related Maintenance Images][Image] , 1)

As far as what is wrong with your expression, not sure, but I would suspect the condition in the select statement. Try to remove the any() and top(), and make sure the select is actually returning what it should be. Perhaps [ID], is the key-column of the images table, and not the ref column to the parent table?

3 Likes

Amazing, Searching google and on the community I came up with Top :stuck_out_tongue:, Learned something new again. Amazing. Thanks,

You might also try searching our documentation site. :slight_smile:




2 Likes

[_THIS] should be [_THISROW].

3 Likes

Thanks Steve, Extremely Helpful

1 Like