Skip to main content
Participating Frequently
Oct 17, 2022 1:40 PM UTC
Question

Expression To return Screen type (Phone, Desktop, tab, desktop_wide etc)

I want to get the current screen type in which my interface opened.
Here screen type I mean : "PHONE" , "DESKTOP", "DESKTOP_WIDE" etc 
I tried using a!isPageWidth() but that is not working for my requirement.

Please help me with this.
Thank you in advance!! 

    7 replies

    Participating Frequently
    Oct 17, 2022 1:59 PM UTC

    a!isNativePhone() and a!isNativeTablet() both functions are deprecated from appian new version.
    And these functions will return true/false.
    But my requirement is dt it has to return screen type only.

    Participating Frequently
    Oct 17, 2022 2:11 PM UTC

    Hi it is not having exact same as you want but please check the stackWhen component on the columns layout https://docs.appian.com/suite/help/22.3/Columns_Layout.html

    Edit: You can try this

    a!richTextDisplayField(
      value: 
      if(
        a!isPageWidth("PHONE"),
        "PHONE",
        a!isPageWidth("DESKTOP"),
        "DESKTOP",
        a!isPageWidth("DESKTOP_WIDE"),
        "DESKTOP_WIDE",
        a!isPageWidth("DESKTOP_NARROW"),
        "DESKTOP_NARROW",
        "i DONT KNOW"
      )
    )