16
Views
10
Comments
Solved
URL should have http or https
Application Type
Reactive
Service Studio Version
11.10.3 (Build 36496)

In reactive, I want to implement logic in a screen input widget where if someone doesnt put a url starting with http or https it gives an error upon saving, what is the best way to accomplish this?

Rank: #94
Solution

Hello Peter,

You can use OnBlur event:

This event occurs when an object loses focus.

Hope that this helps you!


Kind regards,

Rui Barradas

Solution

Hi Peter,

You can check with  If(Index(URL,"https://") <> -1,true, false) to check whether user enter url with https.

or

you can automatically append it, if user not added like :  If(Index(URL,"https://") <> -1,URL, "https://" + URL) 

Hope this works .

Good Day.

Thanks,

Samiksha

Rank: #3060

Thank you everyone!  I think we need to go with Samiksha's coupled with Rui's suggestion here.  Is there a way once they tab out of the input widget and onto the next field to automatically do this without saving?

Rank: #94
Solution

Hello Peter,

You can use OnBlur event:

This event occurs when an object loses focus.

Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #3060

Thank you, so once I set that event, then I have to set up the handler, right?

yes peter on change of that input field.put if condition xyzID<>nullidentifier() (for update condition) if yes then update else not

Rank: #94

Hello Peter,

That's correct :)

The handler is the action that will be executed once the event is triggered.

Rank: #94

Hello Peter,

Hope you're doing well.

As far as I understood, you have an input in your screen where the user will insert an URL (text value) and you want to validate if that text starts with "http" or "https", right?

If so, you may try to use SubStr() built-in function to get the first part of the URL that the user inserted in your input widget and then compare with the string "http" or "https". You may also consider to compare with "http://" or "https://".

You can take a look at this function in here: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Text#Substr


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #67

Hi Peter,


If you want to force the user to navigate to your page via HTTPS (which is a good security measure by the way), you can do it very easily through LifeTime. For that, you should navigate to the menu entry Environments, select the environment you want to apply these settings, and choose option More Security Settings, like on the screenshot below:




Then you just need to make sure you have the settings under Secure Connections turned to On:



Take into account that after you do these changes you may need to confirm them in Service Center.


Hope it helps.


Kind regards,
João

Solution

Hi Peter,

You can check with  If(Index(URL,"https://") <> -1,true, false) to check whether user enter url with https.

or

you can automatically append it, if user not added like :  If(Index(URL,"https://") <> -1,URL, "https://" + URL) 

Hope this works .

Good Day.

Thanks,

Samiksha

Rank: #3060

Thank you everyone!  I think we need to go with Samiksha's coupled with Rui's suggestion here.  Is there a way once they tab out of the input widget and onto the next field to automatically do this without saving?

Rank: #94
Solution

Hello Peter,

You can use OnBlur event:

This event occurs when an object loses focus.

Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #3060

Thank you, so once I set that event, then I have to set up the handler, right?

yes peter on change of that input field.put if condition xyzID<>nullidentifier() (for update condition) if yes then update else not

Rank: #94

Hello Peter,

That's correct :)

The handler is the action that will be executed once the event is triggered.

Rank: #3060

Thank you everyone!

Most welcome Peter ....Happy coding :)