Answered

Query form with logged user information (hidden)

Hi, i have a question - a little problem with my Entity Query.

I created a query form and do everything as supposed in your guide through Entity Query.

When i added a Hidden field and try to filter it , I see that the filter option is not available at all.

The field i try to make HIDDEN is a string field which i am going to try and filter so i can get the rows from the ENTITY that are for the current logged user.

In every row is written a name and i want to take only the rows for the current logged user ( that match the name in the entity row ).

Can you tell me how can i activate the filter or to do this in some other way?!

I am sure that i have made the query properly and set all the parameters well but the filter option is not available.

Best Answer
photo

Dear Stole,

For an entity query, you would need to:

1. Include this hidden field with the "YourWFUserAttribute.idUser" databinding.

2. Create a default value expression for this render:

credentialqueryforms

The expression would just have to return the logged user's Id:

Credential.UserId;

You will most likely be warned that the "Credential" variable has not been declared while saving the rule, but this message may be ignored (because an entity query does not need this process context).

In addition to this, notice that you may also want to include again another databinding to the "YourWFUserAttribute" as a non-editable combo, just so that the user can mark its checkbox to explicitally have the WFUser in the query results.

Best regards,

photo
0

Dear Stole,

To filter according to the logged user you may use directly the "users to include" option:

userstoincludeqf

Best regards,

photo
0

Hi, as i pointed out this is an ENTITY Query - so the option for the Users to include does not help here, it is not a case so it cannot be connected to the case data directly with the user, so it has to be done on some other way.

That is why i try to create a HIDDEN field ( that has the data binding with the field in the database row where the name of the responsible person is written ) and try to filter it with the current user. But when i create the HIDDEN field the filter option is not shown, so i was asking how can i fix that or there is other way to solve this.

Thank you

photo
1

Dear Stole,

For an entity query, you would need to:

1. Include this hidden field with the "YourWFUserAttribute.idUser" databinding.

2. Create a default value expression for this render:

credentialqueryforms

The expression would just have to return the logged user's Id:

Credential.UserId;

You will most likely be warned that the "Credential" variable has not been declared while saving the rule, but this message may be ignored (because an entity query does not need this process context).

In addition to this, notice that you may also want to include again another databinding to the "YourWFUserAttribute" as a non-editable combo, just so that the user can mark its checkbox to explicitally have the WFUser in the query results.

Best regards,