Using a picker when the datasource requires TWO pieces of data?

  • 24 August 2015
  • 2 replies
  • 4 views

Badge +4

We've run into a problem with the picker control.  Our datasource is a custom piece of integration with two fields.  One is a required text field, the other is the field used to search for Full Name.  The picker doesn't like this.  We've tried hard-coding the required value and just searching for the Full Name, but that doesn't work for one simple reason: the datasource returns *nothing* until both the required field and the Full Name field are populated.  When we type a value into the picker, it's attempting to search a datasource that it expects to be pre-populated, but we don't know what the Full Name is until the user types it in so the datasource is empty!

 

Any ideas on a workaround?  The closest we got was using a text box.  If we type the Full Name into the text box and then type the Full Name into the picker then the picker will pre-populate the datasource based on the Full Name in the text box and then the picker will search for the Full Name out of the pre-populated datasource.  This won't work for what we need.


2 replies

Userlevel 1
Badge +8

Hi Chris

 

I'm not sure I fully understand your issue, but have you tried adding the required field as an input property into the populate the picker statement in the "When the Picker is Resolving" rule?

 

Badge +5

Hi Chris, also if your required text is known or can be obtained via rules then you can transfer it to a text box then use a rule to populate the Picker control when the value of the text box changes.

 

For instance if the text box requires the logged in username or some value that ties to the logged in user, I will add a hidden text box "RequiredText" and I would populate "RequiredText" with data on form initialize or whatever applies.

Then I would add a rule to "RequiredText"; when the control "RequiredText" is changed (if "RequiredText contains a value) then populate "Picker Control" with values. Then I would pass in "Required Text" as one of the inputs.

 

That way Picker control only populates with data if the "RequiredText" is present.

Reply