Results 1 to 31 of 31

Thread: V7 Variables List

  1. #1
    Axure Support/Admin
    Join Date
    Jul 2011
    Location
    San Diego, CA
    Posts
    1,668
    Thanks
    264
    Thanked 616 Times in 305 Posts


    V7 Variables List

    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



    Attached Files Attached Files
    Last edited by Ian Gardner; 10-06-2014 at 02:35 PM.

  2. The Following 33 Users Say Thank You to Paul Axure For This Useful Post:

    AutumnBeth (04-04-2014), Ben78 (08-12-2015), borryshasian (07-08-2013), Candourist (05-02-2016), ChannelIQ (03-21-2014), DavidMorgan (07-16-2013), Difaroo (01-20-2014), DKRathbun (04-21-2014), easyishard (09-17-2013), Emgee (04-07-2016), forma (07-12-2013), fred_beecher (08-10-2013), icona (02-01-2016), iLonnie (01-27-2015), Isuro (07-08-2014), jampa (03-19-2014), Jeff Harrison (07-03-2013), jimbunzol (07-11-2013), joshuapekera (04-08-2014), Ling (08-06-2014), maakbow (01-19-2015), mitchpberg (05-22-2015), Mrinal03 (07-30-2013), Muensterberg (08-06-2013), Nataraj (08-28-2014), nicolaskfan (02-24-2015), phelpsb (03-31-2016), shunz (08-09-2013), spiritjp (11-24-2013), uxsb (08-22-2013), WhyNoOpenID (11-20-2013), Zuvala (09-24-2014), _Mr_Spike_ (08-28-2013)

  3. #2
    Apprentice Level
    Join Date
    Aug 2010
    Posts
    70
    Thanks
    36
    Thanked 70 Times in 18 Posts


    The [[Now.getTime]] isnt working

  4. #3
    Axure Developer
    Join Date
    Feb 2012
    Location
    San Diego, CA
    Posts
    2,252
    Thanks
    116
    Thanked 669 Times in 484 Posts


    Hi zinkzone,

    Those are actually functions so you have to type them as [[Now.getTime()]].

  5. The Following User Says Thank You to Ian Gardner For This Useful Post:

    zinkzone (07-26-2013)

  6. #4
    Apprentice Level
    Join Date
    May 2011
    Location
    Brussels
    Posts
    14
    Thanks
    11
    Thanked 4 Times in 2 Posts


    My Twitter My LinkedIn
    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.
    David Morgan
    Human-centered designer at Namahn
    @DavidMorganUX

  7. #5
    Axure Fu Master
    Join Date
    Aug 2008
    Location
    Gold Coast, Australia
    Posts
    121
    Thanks
    11
    Thanked 3 Times in 1 Post


    My Twitter My LinkedIn
    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" ?
    --
    Mark Johnston

  8. #6
    Axure Hacker
    Join Date
    Aug 2013
    Location
    Hamburg, Germany
    Posts
    17
    Thanks
    7
    Thanked 2 Times in 1 Post


    My Twitter
    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. :-)

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

  9. #7
    Axure Support/Admin
    Join Date
    Jul 2011
    Location
    San Diego, CA
    Posts
    1,668
    Thanks
    264
    Thanked 616 Times in 305 Posts


    Thanks it's been fixed.

  10. #8
    Axure Fu Master
    Join Date
    Feb 2009
    Location
    Hemel Hempstead, Hertfordshire, UK
    Posts
    141
    Thanks
    10
    Thanked 41 Times in 33 Posts


    My Twitter
    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.
    ---
    Col

  11. #9
    Getting there
    Join Date
    Jun 2013
    Location
    Israel
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts


    My LinkedIn
    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?

  12. #10
    Axure QA Manager
    Join Date
    Dec 2012
    Location
    San Diego, CA
    Posts
    655
    Thanks
    129
    Thanked 177 Times in 134 Posts


    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
    Last edited by Ben Axure; 10-17-2013 at 08:53 AM.

  13. The Following User Says Thank You to Ben Axure For This Useful Post:

    Meirion (05-06-2015)

  14. #11
    Sifu
    Join Date
    Dec 2011
    Location
    Chicago, IL
    Posts
    840
    Thanks
    143
    Thanked 228 Times in 159 Posts


    My Twitter My LinkedIn
    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
    Svetlin Denkov
    User Experience Professional
    Twitter: @svetlindenkov LinkedIn: http://linkd.in/JbZDre
    Meetup: http://bit.ly/1qITjzK

  15. #12
    Getting there
    Join Date
    Jun 2013
    Location
    Israel
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts


    My LinkedIn

    No Go

    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

  16. #13
    Axure QA Manager
    Join Date
    Dec 2012
    Location
    San Diego, CA
    Posts
    655
    Thanks
    129
    Thanked 177 Times in 134 Posts


    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

  17. #14
    Getting there
    Join Date
    Jun 2013
    Location
    Israel
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts


    My LinkedIn
    How embarrassing... 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.
    Last edited by shafir; 10-21-2013 at 10:09 PM.

  18. #15
    Newbie Level
    Join Date
    Jun 2013
    Location
    Wisconsin, USA
    Posts
    3
    Thanks
    3
    Thanked 0 Times in 0 Posts


    Split Function

    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.

  19. #16
    Newbie Level
    Join Date
    May 2014
    Location
    United States
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts


    move to widget location

    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

  20. #17
    Axure Developer
    Join Date
    Feb 2012
    Location
    San Diego, CA
    Posts
    2,252
    Thanks
    116
    Thanked 669 Times in 484 Posts


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

    Then, this should work:
    Code:
    [[myWidgetVarName.X]]

  21. The Following User Says Thank You to Ian Gardner For This Useful Post:

    mcgreave (08-01-2014)

  22. #18
    Newbie Level
    Join Date
    May 2014
    Location
    United States
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts


    Thank you for explaining this! Great feature!

  23. #19
    Newbie Level
    Join Date
    Sep 2012
    Location
    Austin
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post


    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?

  24. #20
    Axure QA
    Join Date
    Jul 2014
    Location
    San Diego, CA
    Posts
    261
    Thanks
    11
    Thanked 65 Times in 50 Posts


    Hi karan_shukla,

    Thanks for the feedback! That's a great suggestion, and we'll look at getting some more examples up on the forum soon.

    As for your question, you can accomplish this by using the OnPageLoad and OnWindowResize events to set the panel states' heights to [[Window.height / 2]].

    Check out the attached .rp file to see this in action!
    Attached Files Attached Files

  25. The Following User Says Thank You to Julie Axure For This Useful Post:

    karan_shukla (08-31-2014)

  26. #21
    Newbie Level
    Join Date
    Sep 2012
    Location
    Austin
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post


    Julie! Thanks a lot. This is exactly what I wanted. In the interim, I did try something else as well and that was to just use dynamic panel ordering. So I made the Messages panel Go on top of the Activity Panel. That seemed to work too.
    But your quick prototype was really helpful.

  27. #22
    Newbie Level
    Join Date
    Oct 2014
    Location
    Ukraine
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts


    how to use fromCharCode?

    I tried this [[String.fromCharCode(65)]] and it doesn't work. It should show the letter "A".

  28. #23
    Axure Developer
    Join Date
    Feb 2012
    Location
    San Diego, CA
    Posts
    2,252
    Thanks
    116
    Thanked 669 Times in 484 Posts


    Hi rubiroid,

    Sorry, while fromCharCode is supported in JavaScript, it isn't yet supported in Axure. Not sure how that got in there, I have edited the list to more closely match the functions allowed in Axure. Thanks for pointing it out!


    We will definitely look at supporting fromCharCode and more in the future.

  29. #24
    Newbie Level
    Join Date
    Jan 2015
    Location
    Paris
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts


    My Twitter My LinkedIn
    Thanks a lot !

  30. #25
    Apprentice Level
    Join Date
    Aug 2015
    Location
    Reality
    Posts
    82
    Thanks
    39
    Thanked 1 Time in 1 Post


    My LinkedIn
    I have no idea how to use these functions, but I really want to start using them. Axure has a built in tool to help you build custom conditions, it would be nice to have that for functions.
    Is there anything like a quick tool to get what I need done. For now I just want to use a function that causes a wigdet to dynamically fill a given pixel space such as 640 x 2000 but not fill a particular area within that space at the top such as the header area. So you would click the button which would expand to fill the specific space except for the top area.

    can anyone help. Thanks

  31. #26
    Axure Support/Admin
    Join Date
    Sep 2014
    Location
    San Diego, CA
    Posts
    1,549
    Thanks
    74
    Thanked 287 Times in 260 Posts


    Hey Chad,

    You're working in the 8.0 beta, right? Would using the "Set Size" action with an anchor point set to "top left" do the trick for you? That idea could work if the widget that you want to resize is sitting directly below the header that you don't want to have overlapped.

    If you have a specific size that you want to set the widget to then you can specify in the "width" and "height" fields in the case editor. If you want it to do something else like fill up the entire width or height of the browser, then you can click the "fx" button next to the width and height fields to add functions that will let you do that. If you want it to fill up the entire width of the browser, you can set it to [[Window.width]]. Similarly for filling up the window height, you could set the height to [[Window.height]]. Those functions are available in the "Window" section of the "Insert Variable or Function" list.

    If you want to do something like make the height of a widget match the height of a browser but now cover up a header, then you can set the height to something like [[Window.height-(your header's height)]]. For example, if your header is 100 pixels tall, you would put [[Window.height-100]].

    If the height of your header is going to be changing sizes too, then you can set up a local variable in the function editor that corresponds to your header. For example, LVAR 1 == your header widget. You could then write something like this:

    [[Window.height-(LVAR1.height)]]

    That should allow your widget to adjust to the height of the browser minus whatever the height of your header becomes.

    Variables can get a little crazy. Hopefully that made sense!

  32. #27
    Apprentice Level
    Join Date
    Aug 2015
    Location
    Reality
    Posts
    82
    Thanks
    39
    Thanked 1 Time in 1 Post


    My LinkedIn
    Well I feel a little bad I guess because I chose to go a different route. However if I use this feature in the future this will be helpful. The reason I had to use fx is because I had 4 square horizontal buttons. The outer buttons expanded fine, however the two inner buttons could not be set to fill the space based on the allowed parameters of fill to space animations. If this makes sense great. If not not worries.

    Thanks!

  33. #28
    Apprentice Level
    Join Date
    Dec 2013
    Location
    Orlando, FL
    Posts
    26
    Thanks
    13
    Thanked 1 Time in 1 Post


    My LinkedIn
    Sorry, figured it out. Unlike setting text on the widget from the data set, the variable values from these random functions don't display until you preview or publish.

    Regards,
    __________________________________________________ ________

    How do I get the value of one of these variables to appear on a widget?

    I'm a relative newbie to Axure. I've read the thread above and another tutorial on this, but nothing is working. My mock has a grid. I'd like for one of the widgets to display a random number, to represent a field ID.

    The grid is generated from a repeater. I currently have text being derived from the repeater dataset (on item load set text on blah to blah). I assume some of them could be derived from these variables, as opposed to typing it into the repeater data set.

    I've tried the following, but neither works:
    * under repeater item interactions, on item load set text on blah = to value of math.random
    * under repeater item interactions, on item load set value of variable (one I made) to math.random, and on item load set text on blah to (the variable I made)
    ** same thing on load (as opposed to on item load)

    Regards,
    Swish
    Last edited by swish7; 11-11-2015 at 08:19 AM.

  34. #29
    Sifu
    Join Date
    Jul 2013
    Location
    Chicago, IL, U.S.
    Posts
    1,899
    Thanks
    40
    Thanked 503 Times in 467 Posts


    Quote Originally Posted by swish7 View Post
    Sorry, figured it out. Unlike setting text on the widget from the data set, the variable values from these random functions don't display until you preview or publish.

    Regards,
    __________________________________________________ ________

    How do I get the value of one of these variables to appear on a widget?

    I'm a relative newbie to Axure. I've read the thread above and another tutorial on this, but nothing is working. My mock has a grid. I'd like for one of the widgets to display a random number, to represent a field ID.

    The grid is generated from a repeater. I currently have text being derived from the repeater dataset (on item load set text on blah to blah). I assume some of them could be derived from these variables, as opposed to typing it into the repeater data set.

    I've tried the following, but neither works:
    * under repeater item interactions, on item load set text on blah = to value of math.random
    * under repeater item interactions, on item load set value of variable (one I made) to math.random, and on item load set text on blah to (the variable I made)
    ** same thing on load (as opposed to on item load)

    Regards,
    Swish
    I just tried your first method and it works fine. It's not evaluated until you run the prototype, so it won't show up in Axure. If you preview it, you'll see it worked fine. That said, Math.random() produces a random number between (excluding) 0 and 1, so you might want to pretty it up as it will look something like 0.009889078. If you wanted a 6 digit number, try [[(Math.random() * 1000000).toFixed(0)]]

    EDIT: Just saw your edit that you figured it out on your own, I left my browser open
    Nathan K.

  35. The Following User Says Thank You to nkrisc For This Useful Post:

    swish7 (11-11-2015)

  36. #30
    ubu
    ubu is offline
    Apprentice Level
    Join Date
    Dec 2014
    Location
    India
    Posts
    20
    Thanks
    7
    Thanked 1 Time in 1 Post


    This may be a dumb question but isn't this list a set of functions that call in or manipulate values that are either stored in variables or inherent in page elements and DOM? It's just a little confusing to see these listed as variables,when they're described elsewhere as named containers waiting for a value assignment. Aren't these functions used to call or assign values TO variables?

  37. #31
    Sifu
    Join Date
    Jul 2013
    Location
    Chicago, IL, U.S.
    Posts
    1,899
    Thanks
    40
    Thanked 503 Times in 467 Posts


    It's a mix of both. Some are variables/properties (Window.scrollY, String.length) and some are functions that return a value, Math.random(), String.substring()

    Not all variables can be assigned. Some have their assignment determined by Axure (Window.height) while some can be assigned a value by you, such as any global variable you create.
    Nathan K.

  38. The Following User Says Thank You to nkrisc For This Useful Post:

    ubu (02-23-2016)

Similar Threads

  1. How do I create interaction between a List Box and Drop List?
    By Ninja Bob in forum 6.x Archived Questions
    Replies: 1
    Last Post: 01-31-2012, 03:16 PM
  2. Reset List Box
    By kingsargon in forum 6.x Archived Discussions
    Replies: 1
    Last Post: 05-26-2011, 10:58 PM

Search Engine Friendly URLs by vBSEO 3.6.0 PL2