URL in Perspective

Hello everyone,
I'm new with ignition and trying currently working on a project. I have a memory tag which has a string vale (string value will be different every time) ex : "https://www.google.com/" I want to pass this value by using memory tag in URL. Is it possible?
As the string value in memory tag will be different every time depending on what user inputs.

1 Like

Not in a Navigation Action. In a Script Action, you can read the memory tag, combine its value with a static fragment (if desired), and use the string as an argument to system.perspective.navigate().

{ For user entry, you probably should not be using a memory tag. Have the script read the text from the user input component instead. }

1 Like

Hi Phil,
Can you please guide me as what you mean when you say use string as an argument?
I know this must be a lot basic for you but I'm just getting started in this field.

Thank you

If the entire URL is in the string memory tag, this should work in your script action:

	my_url = system.tag.readBlocking(['Some/Path/To/Tag'])[0].value
	system.perspective.navigate(url=my_url)

If navigating to another page within your Perspective project, you wouldn't use the url= format.

1 Like

M'I doing this right?
This is my tag.


and this is the way I'm using the scrip you mentioned

But it is not working as expected

1 Like

Your third line is indented too far. Note the red mark in the right margin signalling this syntax error. Python is very specific about required indentation (and spaces versus tabs matter).

It otherwise looks fine.

However, you seem to be attaching this event to your text area. That will produce many extra events as the user edits and positions the mouse, et cetera. You probably want this action script to be on a separate button.

Also, recall my suggestion to not use a memory tag. The script on a button could get the URL text directly from the text area's text property.

1 Like

Alternatively, you can use a tag binding to your memory tag in a custom property added to your component, then reference that custom property in the navigation action. Click on the little box with lines in it icon to the right of the url input box in the nav action to open the property selector

Thank you Phil.
Yes I attached the script to button instead of text.
Next I'm going to Try not to use memory tag. an try to use text directly from text area.
Also I will be trying to open this url in a new page instead.
I will try to do this if I came across issue will post here.

Also Thank you Nick, I will try to do this using binding to learn as well.

Thank you for your suggestions.

1 Like