Slider Range Min - Max Value Help

been messing with this for a few hours, I think its a bug. I am not able to set a slider range with saved data from my database.

Short Question: Trying to set min - max slider range from database number.

Long Question: Trying to set min - max slider range from prevision session. I have successfully saved range (min and range max) to the database but cant get the syntax right to set the min max from the saved database numbers after page refresh. Slider resets back to its default state. Any ideas?

1 Like

Hey @jnbridges :slight_smile: Can you share a link to your app editor?

If you have a field on the User which stores a numeric range (“NumericRange” here, for example), then you can display the values with a slider using:

If you’d like to save the numeric range any time either the min or max is changed, you could enable autobinding (doesn’t cost any workflows) or set up a workflow such as:

1 Like

Hi thanks for your tips. yes saving the values to the database has worked as expected. Its then applying those numbers as the min/max to another slider that doesn’t work. What I have experienced is, once you apply a dynamic value to the max in a range slider, it breaks the slider.

Scenario: User chooses 2 and 8 on a range slider (slider a). Those values get saved to a database. Once you try to make them the min/max on (slider b) the slider breaks.

No problem at all :slight_smile: I’m able to set the values on a second slider as well. Could you share a link, or some screeenshots of how it’s setup in your app?

hi i have a demo of my demo, not sure how to share it with you.

If its a copy of the app, you can go to the Settings tab on the left-hand side in the demo app, then select ‘Everyone can edit’ if that app is currently set to private.

Then copy+paste the URL (of the editor, not the live preview) :slight_smile:

thanks for looking at this. did that work?

Great thanks :slight_smile: Have the editor open now. I think this may have to do with the data structure.

To clarify, you would like the User to be able to enter an employee name, and a slider range. Then you’d like to save this employee name and range and display it in a second slider within a repeating group?

Yes, pick a name, then range, then save name and range. Then ideally on another page, display all the saved names and the ranges/sliders. right now when you refresh the page the range goes back to the default.

Got it! I created a new page in the app called ‘slidercopy’ just so you could see the difference between the pages. Then placed a field within the Employee data type called ‘SliderRange’ (type: numeric range, List: no). You could use two separate number fields, but this way you can save the range as one expression in the workflows.

Though the saved slider values are now stored within a single field, you can still query the minimum and maximum values using ‘CurrentUsersSliderRange:min’ and ‘CurrentUsersSliderRange:max’ when needed.

The repeating group of Employees only displays Employees whose SliderRange field isn’t empty:

When a SliderRange needs to be updated, you can just move the sliders within any cell, and click Update. This makes changes to the Current Cell’s employee, adjusts their SliderRange field, and then shows an Alert that the changes were saved:

When adding an employee and new SliderRange, the Searchbox only displays User names whose SliderRange field is empty:

Then the workflow saves the SliderA value as the new SliderRange value for the User in the Searchbox:

Save Button Workflow:

And that should do it! Feel free to let me know if this is what you had in mind, or if you have any questions at all. :slight_smile:

1 Like

Hi Faye

OK, wrapping my head around this one, and I can already see where my lack of knowledge has taken me down the wrong rabbit hole. Is there a way to private message you so I can I ask you a few questions about what I am trying to accomplish? The demo you worked on is vague on purpose.

Thanks! Jeff

Ok so I was messing around with your code, because its awesome, and got it to almost work.

The weird thing is, when I update (also when it auto-binds which is preferred, happens on both…) the new range “sticks” AND the database shows that the data was modified, BUT the range [#,#] does not change from its original saved range.

So the page is correct, and i can go out, refresh, etc. and the new updated ranges stay, but the database always shows the original range.:confounded:

false alarm, i closed completely out of my browser and went back in and the database reflected the changed values. Thank you again for all your help, i think this will help me a great deal.

1 Like

Awesome! My pleasure, @jnbridges :blush: Yes absolutely, if you have any questions at all feel free to PM me about adjusting the setup in your other app - happy to answer any questions there!

This topic was automatically closed after 70 days. New replies are no longer allowed.