Input value for slider element on a web page

Hello UIPath forum!

Can someone please help!

Im trying to create a simple input dialog for a Price slider element on a web page (as shown below)

I was wondering is there a way to project that slider element into a input dialog, so that the user could dynamically choose a different price every time the process is run.

Or

The user could type a price into a input dialog box and then the slider would go to that price point on the slider element.

If anyone has done this, has any tips or tricks or an example it would be greatly appreciated! :slight_smile:

Ive seen posts for slider elements, but non of them seem to be done through a input dialog window, with a dynamic value.

KR,

-Robbie

1 Like

If possible, kindly share the web page.

It will be easy to provide you a sample code.

But anyway, the approach should be like adding an input dialog and the output of it should be appended to the selector making it dynamic.

Thanks :slight_smile:

1 Like

Hi @Nithinkrishna,

The webpage in question is https://www.trivago.com/ :slight_smile:

-Robbie

1 Like

Yep, Here is the workaround.

I have used this page - https://www.trivago.in/?aDateRange[arr]=2020-11-17&aDateRange[dep]=2020-11-18&aPriceRange[from]=0&aPriceRange[to]=10447&iRoomType=7&aRooms[0][adults]=2&cpt2=64991%2F200&hasList=1&hasMap=1&bIsSeoPage=0&sortingId=1&slideoutsPageItemId=&iGeoDistanceLimit=20000&address=&addressGeoCode=&offset=0&ra=&overlayMode=

Sample code - Slider.zip (2.8 KB)

You can optimize it as your need.

Hope this Helps.

Thanks

1 Like

Great example @Nithinkrishna

Thank you very much! :slight_smile:

1 Like

Hi @Nithinkrishna

One more question about Cint(PriceVal) > CInt(priceNow.Replace(“,”, “”))

im guessing (“,”, “”)) refers to the price (e.g ₹8,356)

so how would i write the same for 100€?

Thank you!

1 Like

yep @RobbieJ, Happy to answer.

priceNow.Replace(“,”, “”) - This is to just replace comma in price to convert that to valid integer for comparison.

And there was no currency coming from the attribute which I used. If you want you can replace the Euro symbol as well with the same method

Hope this helps :slight_smile:

1 Like

Ok got it! how would i write the same expression if there is no comma in the price? as the prices in my case are all under 500.

The slider function goes all the way to zero no matter what value i enter at the moment, so could it be related to this?

Thanks :slight_smile:

1 Like

Hey @RobbieJ,

Good day.

If you don’t have a comma in the price, just remove the replace part. But having it either doesn’t cause any issue.

Btw, we can’t set the exact value we want in few sliders based on the application. For example, in the trivago link, there are few presets in the slider values only which we can select - nearest to our value.

If the slider you are trying, has only presets 0 and 500 with no other values in between you cant able to choose because hitting left arrow once will change the slider value from 500 to 0.

Think you can get this.

Thanks :slight_smile:

Let me know for anything.

1 Like

Hi @Nithinkrishna,

Thanks, for some reason it keeps doing the same thing, could you please take a look at it and see if there is something wrong?

Slider.xaml (12.4 KB)

I have been using this country version of trivago:

Thank you :slight_smile:

1 Like

Hey @RobbieJ,

There was a small selector issue in the get attribute - I just corrected it as below.

image

It works fine now. Let me know for any issues.

Ref - Slider modified.zip (7.7 KB)

Thanks :slight_smile:

Got it now!

You’re a lifesaver @Nithinkrishna

Thank you very much, have a great day! :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.