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!!
Discussion posts and replies are publicly visible
Tablet : //docs.appian.com/suite/help/20.1/fnc_scripting_isNativeTablet.html
Phone : https://docs.appian.com/suite/help/20.1/fnc_scripting_isNativePhone.html
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.
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" ) )
It does seem a bit backwards that we require such a work-around to GET the current page width - to me it seems like there should've just been a "a!pageWidth()" function that RETURNS the current page width, i.e. the inverse of what we have to do with a!isPageWidth. I assume they have reasons, but...
I suppose it might be helpful to build it in such a way that we could maintain a separate array of valid widths (like in a constant) then have a rule simply iterate over that list and find the valid width (if any).
/* rule!GLBL_getPageWidth() */ a!localVariables( local!widths: { "PHONE", "TABLET_PORTRAIT", "TABLET_LANDSCAPE", "DESKTOP_NARROW", "DESKTOP", "DESKTOP_WIDE" }, index( a!flatten(a!forEach( local!widths, if( a!isPageWidth(fv!item), fv!item, {} ) )), 1, "Unknown" ) )
yes working perfect, Thank you so much
Yes its working fine with nested if. Thank you !!