Using results of a query as list box input
I have a current workflow that selects an election precinct and polling location based upon a user input street address and ZIP. The user inputs and selects the address via a Display Form Autocomplete Box, and then selects one or more ZIP codes from a ListBox based on the address chosen in the Autocomplete Box.
If there is more than one address matching the input, then choosing a ZIP code seems natural. But if there is only one address matching the input, it just seems redundant to have to choose the one ZIP code. I’d like to take my workflow to the next level and only have to choose a ZIP if there are duplicate addresses.
I’ve gotten to the point where I have a query based on the input address, then a Decision determines if there’s one address or more than one address: If there’s just one address, the workflow continues to selecting the precinct & poll location. But I don’t know where to go with the “more than one address” option….. I’m assuming I need to use the queryResult multiple addresses (queryResult.Features.Count > 1) as the input for another Design Form so the user can select their ZIP and then have the rest of the workflow run. But I can’t figure out exactly how to make that work! Anybody have any suggestions????? I’m sure there has to be an example like this somewhere, but I haven’t found it yet!
0
-
If I understand your workflow correctly (you want to present a list of valid ZIP codes when the address exists in multiple ZIP codes), then I think what you're looking for is in the beginning sequence of this sample workflow:
https://drive.google.com/open?id=0B_hHHiqcTKMfeElqc19iVjM2djg
So, after you run the Query Task that returns the queryResult feature set, you could use FeatureSetToDataItemList to create a new DataItem List. Then you'd use it as the Input Data for the ListBox in your Display Form.0 -
Thank for your reply, John,
Yes, I believe you've assessed the situation correctly, and it makes sense to me, but that doesn't mean I can get it to work (bc I can't)! This can't be this hard, but I'm ashamed to say how much time I've spent on this. Incorrect practice does not make perfect!
I've dumbed this waaaay down...... Where am I off?
https://drive.google.com/file/d/1pkhFOmZaUpgATlN6IrFXAsaFjlHpMDJC/view?usp=sharing
Thanks so much!0 -
Do you have a sample address that would be in multiple ZIP codes I can use to test it out? 0 -
65 S MAIN ST
You ROCK, Dude!0 -
Alright, I think I found the issue. On your FeatureSetToDataItemList activity you had the display attribute set to ZIPCODE and the value attribute set to FULLADDR. It looks like those are two strings variables in your workflow that have no default value (I couldn't find them being used anywhere else in the workflow).
I updated the activity to use the literal string "ZIPCODE", which is the name of your field (I used it for the display and value attribute, honestly don't know if that matters or not). After that change, I'm getting two address in the ListBox when using 65 S MAIN ST, 84738 and 84745.
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000bqSh&feoid=Body&refid=0EMf2000000cZtT"_/_img_0 -
Omg, John, thanks so much! Simple or not, I can tell you I probably would not have gotten there on my own, I just wasn't seeing it. I will take what I have learned and try to get to the end of my original workflow now. You're the best, Man! I need to buy you a fruit basket! 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare