Workflow to run report trying to get objectid's based on used input into autocomplete form.
I have a workflow that starts with a Display form where; using an auto complete, the user types in a civic address then based on the selection I run a Get Feature Set Object IDs and then am trying to populate those objectids into a Run Report tool (See attached images of WF).
I keep getting an "Expression could not be evaluated "$value1.result" cannot read property 'result' of undefined"
he $value1.result comes from the Create Value I run on the Get Feature set Object IDs (create value expression is =$objectIds1.ids)
What am i missing here?
-
Hi Ryan,
I think $value1 might only be visible within the subworkflow where it is defined. Maybe you could use Create Value in the root workflow without an expression, so you have a $value1 with no result. Then in the subworkflow, where you were previously using Create Value, use Evaluate Expression with the following expression:
=$value1.result = $objectIds1.idsThis would set $value1.result to the same thing as before, but because $value1 is created in the root workflow, it should be visible to the Run Report activity.
0 -
Hi Ryan,
I think you might have a scoping issue. Activity id's that are created inside a DisplayForm event don't exist anywhere outside of that event.
Try using Create Value to create the value before the DisplayForm. Then replace the Create Value activity inside the event with Set Property activity configured like this instead:
Object: =$value1
Property Name: result
Value: =$objectIds1.ids
Another option would be getting values from the form after it's completed instead of trying to get values out of the event. Eg, working with =$form1.state.autoComplete1.value is the normal pattern that we see used
0 -
@Ken Lyon? @Amanda Frech?
Thank you guys tons! I tried both methods and they work great!
0 -
@Amanda Frech? Good call on the use of Set Property. Much tidier than my expression!
0 -
@Ken Lyon? @Amanda Frech?
What about if I want the user to have the option to search by 3 different fields? Currently the auto complete is set up for just the civic address field; however, ideally it would say like "search by civic address, pid or folio". Would I need to triplicate the autocomplete work flow?
0 -
@Amanda Frech?
The method you suggested works; however, if the user types in a civic; for example, "112" and auto complete suggests (for example) 5 civics that start with 112. No matter if the user clicks the proper address they are after, the workflow runs the report on all the suggested values.
Thoughts? I have tried changing the setproperty from =$objectIds1.ids to id etc.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare