You are viewing limited content. For full access, please sign in.

Question

Question

Form Behaviour Change Request - Lookup result when more than one row

asked on March 10, 2016

We are using the latest current LF Form version which is V10.0.0.1154.  I have setup a form with my customer and at one stage in the Form, the user is entering his ID.  From that ID, we have a lookup that is querying a SQL View that will bring a list of addresses where that user lived and the latest one is the current address.  I have setup the orderby to be in reverse order so that the latest address is positioned at ROW1.


This form is working fine for every user that only has one address in file, so only one row will be returned by the SQL Query.


This issue here is when a user has many addresses on file and multiple rows are returned. What is happening is, for any column that does contain the same information throughout all rows, these values will be published to the field, but for every column where data is not the same in every row, form fields will not be populated.  Example: One user was at address “555, Main Street, Los Angeles, CA” and moved to “666, Main Street, Los Angeles, CA” Form field information will only show “Main Street, Los Angeles, CA” and the street number field will be empty.


I have created a case about this behaviour and they say this is the normal expected behaviour.
The expected behaviour would be like in the Workflow Query activity where if multiple rows are returned, Row1 info will be used by default, and if you need to use other info in other rows, then you handle it using a “ForEachRow” activity.  The same behaviour should apply to Forms.  If I want to get all rows in Form for that query, I would setup an array or a Form-Table to push info from Query to the Table.


If your actual behaviour is the expected default behaviour, I think that what I suggested (using ROW1 information) should be the default behaviour and you should be creating a parameter within each lookup that will allow us to select the behaviour we want to use.


I would like to receive a feedback from Laserfiche Forms development team about this.

 

Thank you,
Daniel

0 0

Replies

replied on March 11, 2016

Hi there,

SQL view is not materialized, so it cannot really support order by. http://dba.stackexchange.com/questions/21434/why-does-order-by-not-belong-in-a-view

In your use case, since you can identify a single address, the best practice is to use a stored procedure to output the correct address and it'll be rendered on a form.

 

0 0
replied on March 15, 2016

Hi Abby,

I have managed that ROW1 does contain the latest information.

However, the Forms lookup behavior when multiple rows are returned is still acting in the way I have described in my original post.  It should behave like the Workflow Query Activity where it uses ROW1 information for each column if multiple rows are returned (from a view, or from a normal table).

Can this be addressed for the next 10.1 release?

0 0
replied on March 15, 2016

Hi there,

We'll consider your use case when enhancing lookup capability in future versions. The current behavior will stay unchanged in 10.1.

0 0
replied on April 15, 2016

Hello Daniel,

In your stored procedure, can your select statement be something like:

Select Top(1) field1, field2, etc...

0 0
replied on April 18, 2016

Hi, Just to let you know that I did resolve temporarily this issue but this is a request for a new feature.  Lookup in Forms should behave the same way as it behaves in Workflow.

0 0
replied on April 18, 2016 Show version history

Daniel, another way to do what you are wanting is with your view add a derived column that creates the entire address in one column Present that to the user as a single drop-down field within Forms. Once the choice is selected, it could then perform a lookup rule that populates the individual fields that make up the address so it could be used in other systems (if needed).

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.