Skip to main content
October 17, 2022
Question

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

  • October 17, 2022
  • 7 replies
  • 0 views

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

    October 17, 2022

    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
    October 17, 2022

    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"
      )
    )