a reference selector executes the following by default on opening of the page;
- Retrieves the list of the selected entity
- The constraint on selectable objects is used here to constrain this retrieved list
- Uses the set attribute to display in the list
- If already a reference is set, the referenced object will be displayed using the set attribute
The moment you select an object
- 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.
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;
- A default button actin who creates an object and opens a page
- 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
Solution for scenario 2
- Equal to scenario 1, but incorporate it in the existing microflow
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