Check Device in expression

Hi All

I need to change my text content for desktop and mobile. Can I give IsDesktop and IsPhone condition in expression and change the content?

mvp_badge
MVP
Solution

No. You can do it on two ways:

  1. using the DisplayOnDevice but then you have to fill also the content for tablet
  2. using the if as I did on the last screenshot and you can then insert the content for the phone / tablet and desktop


Cheers,

João

João Marques wrote:

No. You can do it on two ways:

  1. using the DisplayOnDevice but then you have to fill also the content for tablet
  2. using the if as I did on the last screenshot and you can then insert the content for the phone / tablet and desktop


Cheers,

João

 

 Thanks João

mvp_badge
MVP

Hi Kavya,


You just need to use DisplayOnDevice from OutSystemsUI and then you just put on the placeholders the content you want to display in the different devices. Or you can use the IsPhone and IsDevice client actions to control your if on the screen:



Hope it helps.


Cheers,

João

João Marques wrote:

Hi Kavya,


You just need to use DisplayOnDevice from OutSystemsUI and then you just put on the placeholders the content you want to display in the different devices:



Hope it helps.


Cheers,

João

 Thanks João  I did try with the your solution, but then it takes 3 expressions. Can we reduce the count of expressions. In one expression can I use IsDesktop and IsPhone together? 

mvp_badge
MVP

Hi kavya,


Yes, you can use the IsDesktop(), IsPhone() or IsTablet().

So if you want the content on your phone to be the same as on the tablet, you can just use the following:

If it is phone or tablet, it will go for the True branch (in my case "Text to show on Phone or Tablet"). Otherwise, it is desktop and it will go for the False branch (in my case "Text to show on Desktop").


Hope it helps.


Cheers,

João

João Marques wrote:

Hi kavya,


Yes, you can use the IsDesktop(), IsPhone() or IsTablet().

So if you want the content on your phone to be the same as on the tablet, you can just use the following:

If it is phone or tablet, it will go for the True branch (in my case "Text to show on Phone or Tablet"). Otherwise, it is desktop and it will go for the False branch (in my case "Text to show on Desktop").


Hope it helps.


Cheers,

João

 Thanks João . But can we use this condition inside an expression? If possible then how?

 

mvp_badge
MVP

Yes, you can. You just drag an If to the screen and then write the condition IsPhone() or IsTablet, like on the screenshot below:


In this way, you place your text to display on phones and tablets on the True branch and the text to display on desktops on the False branch.


João

João Marques wrote:

Yes, you can. You just drag an If to the screen and then write the condition IsPhone() or IsTablet, like on the screenshot below:


In this way, you place your text to display on phones and tablets on the True branch and the text to display on desktops on the False branch.


João

 Can we use the same condition inside expression João ? Like inside an expression can I give IsDesktop() and its value and IsPhone() and its value? Is that way possible?

 

mvp_badge
MVP
Solution

No. You can do it on two ways:

  1. using the DisplayOnDevice but then you have to fill also the content for tablet
  2. using the if as I did on the last screenshot and you can then insert the content for the phone / tablet and desktop


Cheers,

João

João Marques wrote:

No. You can do it on two ways:

  1. using the DisplayOnDevice but then you have to fill also the content for tablet
  2. using the if as I did on the last screenshot and you can then insert the content for the phone / tablet and desktop


Cheers,

João

 

 Thanks João

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.