V7 Variables List

rp-7

#1

String Functions

length
charAt
charCodeAt
concat
indexOf
lastIndexOf
replace
slice
split
substr
substring
toLowerCase
toString
toUpperCase
trim
toString

More info at
JavaScript String Object

Example, LVAR 1 = Text on Widget substring.

Date Functions

getDate
getDay
getDayOfWeek
getFullYear
getHours
getMilliseconds
getMinutes
getMonth
getMonthName
getSeconds
getTime
getTimezoneOffset
getUTCDate
getUTCDay
getUTCFullYear
getUTCHours
getUTCMilliseconds
getUTCMinutes
getUTCMonth
getUTCSeconds
parse
toDateString
toISOString
toJSON
toLocaleDateString
toLocaleTimeString
toLocaleString
toTimeString
toUTCString
UTC
valueOf
addYear
addMonth
addDay
addHour
addMinute
addSecond
addMillisecond

More info at
JavaScript Date Object

Number Objects

toExponential
toFixed
toPrecision

More info at
JavaScript Number Object

Example, LVAR 1 = Text on Widget numbers.

Math Functions

abs
acos
asin
atan
atan2
ceil
cos
exp
floor
log
max
min
pow
random
sin
sqrt
tan

More info at
JavaScript Math Object

Example, LVAR 1 = Text on Widget substring.

Widget Functions

When using the variables that start with ‘Widget’, you will have to set a local variable to the widget. In the example below I set the value to ‘this’ but you can also choose any widget on the screen.

Widget.Width
Widget.Height
Widget.X & Y (or left, top, right, bottom)
Window.ScrollX
Window.ScrollY
Window.width
Window.height
Label
Cursor.X
Cursor.Y

variables-samples.rp (88.5 KB)


How to create Typeform type of scroll and focus?
Does Axure 8 support the javascript function .startsWith()
Complex prototype with rich data capture
'Count If' (^) in Axure
Exponents in compound expression
Format/translate day of the week
#2

The [[Now.getTime]] isnt working :frowning:


#3

Hi zinkzone,

Those are actually functions so you have to type them as [[Now.getTimeb[/b]]].


#4

What does the Label variable/function return? I was hoping it was the Widget Name.

I would like to be able to create a generic script that I can copy paste onto a series of object. I want the script to look at the name of the object to determine what to do. This.Label or This.Label() doesn’t return anything.

Am I trying to do the impossible?

Thanks.


#5

This is great! Thanks!

Is there a way to check if the scroll is up or down?


#6

Is there any way too check a column contains a string i.e a Genre Column contains the string “Drama”, from the string "“Comedy, Drama, Action” ?


#7

Paul, you have an syntax error: “toLocalTimeString” does not exist in Javascript. Instead write “toLocaleTimeString”. Therefore the function call “toLocalTimeString()” doesn’t work in the current Axure 7 Beta (7.0.3116). Please fix that little bug. :slight_smile:

Anyway: nice list. Is there any plan to have a documentation inside of Axure 7 for that (in the Variables-Dropdown e.g.)?


#8

Thanks it’s been fixed.


#9

I was hoping to be able to test against regular expressions but I can’t see how/if it has been implemented.

As an example, I need to emulate a password strength validation process but it’s going to be very longwinded without Regex support.


#10

Hi guys,
can someone help me out with “indexOf”?
I have a repeater with addresses (Street, city, state) and don’t want to brake them into 3 columns.
I would like to filter all the users from “NY”.
I tried [[item.Adress == ‘Adress.indexOf(‘NY’)’]] with no effect.
what am I doing wrong here?


#11

Hi Shafir,

The indexOf() method returns the index of the initial occurrence of the searched-for string; if that string doesn’t occur in the string that you’re searching, the method returns “-1”. If you want to find users whose addresses contain the string “NY”, you can look for users for whom a search for “NY” does not return “-1”:

[[item.Address.indexOf(‘NY’) != -1]]

With that expression, we’re searching for any user whose address does not not contain “NY”.

Let me know how this works!

Ben


#12

Hi Axure folks,

I was wondering if the original list of functions and/or variables is getting updated to reflect the changes as per the different beta releases. For example, I noticed that “replace()” for String is not included in the list. Just curious!

Also, I am noticing that variables, functions, and operators are all mixed in the original post and also in the drop down for “Inserting a function or Variable” modal in Axure 7. Have there been thoughts to organize the documentation in more of an API fashion per class instance :)? Thanks for any info on the matter!

Best Wishes,

light_forger


#13

Thanks for the help Ben.
Unfortunately I couldn’t get it to work…
since I’m on a deadline, I’ll have to break the city into a column which will probably work (but won’t be elegant:()

Anyway, I uploaded the component I used, maybe you’ll find the error.

IndexOf.rp (73 KB)


#14

Hi Shafir,

You’re very close! Note that there’s a small typo in your Repeater Properties–“address” is spelled “adress”, so the expression from my last post won’t evaluate correctly. If you add that sneaky second “d”, things should work just fine.

I also noticed that you’re on an older beta build. You can grab the most recent one here:

Download V7 Beta | Axure

I hope this helps!

Ben


#15

How embarrassing…:o it’s like HTML in notepad all over again…
I’m gonna dig a hall and sit in it now.

Thanks Ben!

BTW, I don’t know why, but every update to Axure needs the anti-virus / firewall to be turned off.
This is very annoying since it means I have to get a help desk guy to do it every time (Corporate policy) which can take an entire day of down time.


#16

In JavaScript split() returns an array of the substrings. Is there a way to access the resulting array in Axure? All I can get it to do is return the full array (with commas separating the values). I tried using the syntax for accessing array values in JavaScript, but that did not work.


#17

Hello, could anyone please post an example of how to move a widget to the location of another widget using the new “Widget.X” and “Widget.Y” variables?

Thanks!
Steve


#18

You’ll have to set the Widget to a local variable first. Check it out here: Set Widget Values | Axure

Then, this should work:

[[myWidgetVarName.X]]

#19

Thank you for explaining this! Great feature!


#20

Hello,

This is a great thread. A quick suggestion to Axure folks. - When I realized these kind of advanced functions and variables were possible it blew my mind. However I am not that technical to quickly grasp how to use them and mix and match to achieve the desired end result. It would be awesome if someone made a 5-10 min tutorial on these functions with real life possible situations they could be used in. Then most people could refer to that for initial learning and then ask questions as and when. Just my 2 cents.

Now to the question, I am trying to emulate Facebook’s right hand widget column. Where they have an activity ticker and the messaging widget.

  • One they are sticky to the right. But they are also detecting my browser height in a way.

So let’s say I want to have 2 sticky panels on the right of my prototype that detect the browser height and and show up as (window.height/2), one from the bottom, one from the top and show scroll bars as needed.

How may I accomplish this?