Home > Forum > Forms > Dynamic datasource not filtering user input

Dynamic datasource not filtering user input
0

Hi community!

I have to implement a choice field (Autocomplete or Popup), whose results should be dependent of the following:

1. Current step
2. If second choice field is selected, it should narrow down the results from a subquery (Item list)

First of all Webcon doesn't accept a DECLARE statement in the first line of a custom datasource based on 'Current BPS connection'. A workaround here is the 1. statement (IF (1=1)).

This query does seem to work (it is showing the right results in the right step).

What does not seem to work is the filtering on user input. Query seems to be evaluated all the time, showing ALL results regardless of user input.

Is there any other way to achieve such a requirement?

Thanks a lot in advance, best regards, Nik

MVP

Hi Nik,

I have never faced any issues when using field values for limiting the available values.

Example one uses a value from a field while example two uses a union to define a common source out of which only a part would be valid for an instance.

I'm not sure that I understood everything of your query but if Step_Id is referring to the step of the current workflow instance, this could cause problems.
Having one set of available values in the first step while another one in the second step will cause an error, if the value could not be found in the second result set.

Best regards,
Daniel

In reply to: Jacek

Hi Nikolaus,
I don't know if I understood the problem correctly but maybe instead of the "declare" section (1) you should just use the attribute value from the "Form fields" section (3) in place of (2).

Regards,

Hi Daniel & Jacek!

Thanks a lot for the answers.

I initially tried with Form field, but it did not work in the first step (New Form) for no obvious reason. I also was unable to identify, which exact SQL statement was executed here. I think this could be a Webcon bug.

Step Id is not a problem at all, this is working in the new form.

The working solution is a common datasource, which has an additional filter set in designer studio.

Best regards, Nik