Unable to retrieve a specific field value using Query Builder

Hi, Forum.

Is there any way to query a specific filed value from the entity with a certain condition?

For instance, I want to query a filed value from the row of the entity using Query builder whose field matches with “A”.

First, tried to query the corresponding row and store it to dtUserInfo.

(Where userInfo is an Entity, varName is text type variable and dtUserInfo is a Datatable type variable. )

But it fails with the following error.

Can any one walk me through this?

Additionally, is there any way to get the field value with a specific condition directly?

Regards

@hongjoo.choi

you can try like this

FetchOne(of SumCheck)(createFilterGroup(New QueryFilter(){addFilter("name", "=", "abc")}, Nothing, 0), New PaginationProps(dialog.CustomList.PageStart, dialog.CustomList.PageLimit), Nothing, Nothing, New ExpansionFieldOption(){addExpansionFieldOption("CreatedBy", New String(){"Id","Name"}), addExpansionFieldOption("UpdatedBy", New String(){"Id","Name"})}).name

it gives the field value directly…here field is name and sumCheck is my entity

change to your entities

cheers

Hi, @Anil_G Thank you for your help. With the given code, I came across some errors as shown below. Could you please check? FYI, It is Table display being used in the form not the Custom List.

Is there a way to do the same using the Query Builder instead of manually writng down codes, which will be a significant obstacle for users?

Regards

The above expression is for this…to get field value directly after filter

Also in the above just remvoe dialog. etc

whatever it is in your expression in screenshot to get the field value use fetchone and then at the end use a .Name (.FieldName)

If you want to display in tbale then directly using query builder in datasource it would work

cheers

Thank you @Anil_G for clarificaiton.

When tested from my side, it seems the FetchOne didn’t fetch anything from the Entity. Could you guess why?

The first one (“Name from the box”) is the one fetched directly from the downdown box.
The second one (empty) is the result from the code, i.e., FetchOne function.

Double-checked the UserInfo entity from the left panel:

@hongjoo.choi

after observation one thign is we can get the values onlyw hen you assign the fetch to a variable and then use as fetch directly is not returnign values

ls.data.Where(Function(x) x.name.Equals(dialog.Text.Value)).First.name

in the above what I have done is ls is a list source type variable and then on page load add an event to set the value to it usign the actual fetch usign qury builder

and then in the log message used the above expression

also dialog.Text.value is a text control on screen and getting calue from it and filtering to get the value

please try the same

cheers