Skip to main content
Nintex Community Menu Bar
Question

Manually setting the Lat/Long for a distance condition


Forum|alt.badge.img+9

Currently on distance conditions, you have three options for the comparison location source. Fields from another model, running user’s location, and page parameters. I want to be able to filter a list of contacts with the source location being manually selected. I am currently using a dummy model and have tried a combination of Ui Only fields and actual reference fields.

The problem is when using “Fields from another model”, to get the condition to grab the latest change, you have to save that model and update both it and the model being filtered. This is problematic using a dummy model as I do not want to save the changes to it, and a UI only field would be reset doing this. 

I am setting the value for the distance value from my snippet. Is there anyway I’m missing to manually set the Lat/Long for that condition? I feel that would solve my problem.

Did this topic help you find an answer to your question?

6 replies

Forum|alt.badge.img+17

Not exactly the answer you are looking for, but it is probably a quick fix for your issue. I create a custom object called “Settings”. I use it to collect any user preferences for Skuid Pages. You can add a model based on the settings object to any Skuid page and then save values to it as needed. The nice thing is that these changes persist after page refresh, so I use it for user specific filter preferences, background image choices, rendering of certain components like “one-time messages” on page load… very handy tool and it seems like it would fix your problem.


Forum|alt.badge.img+9

I have a similar object called UserSettings that I use. However, I was hoping to avoid adding a field for this.


Forum|alt.badge.img+13

Craig, I think that if the Condition’s Location Source is set to Page parameters, then if you’ve got the Condition object in JavaScript you can populate the latitudeValue and longitudeValue properties and when you re-query, those values will be used as the comparison location, e.g.

<br>var condition = myModel.getConditionByName("some_name");<br>condition.latitudeValue = 35.049309;<br>condition.longitudeValue = -85.3119634;






Forum|alt.badge.img+9

Thank you Zach! This worked very well. I had not tried URL Params or to manually set the values of the condition (although I was checking them in the console). I seem to remember seeing somewhere that condition properties should be treated as read-only and not modified in JS. 


Forum|alt.badge.img+13

I would say, yes, Condition properties should be treated as read-only, but in this case there’s no API for modifying the Lat/Long values manually, and these properties are not likely to change, so I’d say it’s safe.


Forum|alt.badge.img+9

Good to know. Thanks again for the help!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings