Reference Selector is not passing the selected value as parameter to other widget

0
In my current project I am facing two issues.   I have to show a list of values and the user should be able to select any of the values. But when the page loads i want a default value should be selected which is not the case. It always assigns a blank value. I tried all the option including the selectable objects but is not working.     for security reasons I have erased the few letters of the data. Second issues is that I want to select and display another of data in another data view based on the value selected from the above shown reference selector widget but It is always passing a null value irrespective of what i am selecting from the dropdown.   Any suggestions on how to tackle this issue?
asked
1 answers
6

a reference selector executes the following by default on opening of the page;

  1. Retrieves the list of the selected entity
  2. The constraint on selectable objects is used here to constrain this retrieved list
  3. Uses the set attribute to display in the list
  4. If already a reference is set, the referenced object will be displayed using the set attribute

The moment you select an object

  1. it sets the reference => Picks the object ID of the selected object and add that to the reference in the owning object.

Thus the moment when you open the page, the initial value will be empty, because there is not yet set a reference.

Knowing this; 

If you want to have a preselected value you have to reference the default object before opening the page.

Don’t know how your page is opened. But I guess one of the following scenarios;

  1. A default button actin who creates an object and opens a page
  2. A microflow which is triggered somewhere, which opens the page and passes an object

 

Solution for scenario 1

  • Set button to call microflow
  • Create a microflow which creates the required object and open the page, passing the just created object
  • Add BEFORE the create object activity a retrieve from database
  • Retrieve the entity you want to reference
  • Set range to First and add a XPath constraint to define the object you want (no idea what the default should be in your situation)
  • In the create activity, set the reference to the retrieved object
  • Done

 

Solution for scenario 2

  • Equal to scenario 1, but incorporate it in the existing microflow

 

Edit:

If you want to show the details of the selected object, add a nested dataview and connect it over the same path as used for the reference selector. When you use a microflow as datasource, then the dataview will not act upon the selection in the reference selector. By using the same path, the path is refreshed and thus the dataview containing the detains

 

 

answered