Perspective Display different in Chrome than in designer

Hello,

I am trying to understand what is an issue with my project. I Bonded as Expression with few values:

concat({view.params.id_Line},'/',{parent.custom.id_Level_1},'/',{parent.custom.id_Level_2},'/',{parent.custom.copy_id_level_3})

So in the designer looks like this (correct):
image
Just numbers 3/41…

When I run this project in chrome, it looks like this (missing values):
image

So, I am not sure what I am doing wrong.

Best regards
Pawel

how do you fill these custom props?

Number 3 is on the View as parameter (int)
Then number 41 is expression based on this number
Then Number 839 expression based on 41
Then Number 2638 expression based on 839

Here is my expression for number 41. And once 41 number is working all other numbers are working as they are linked together.

Expression for number 41: This way is working in chrome, but not in designer.

if({view.params.id_Line}='0',57,
if({view.params.id_Line}='3',41,-1))

Expression for number 41: This way is not working in chrome, but is working in designer.

if({view.params.id_Line}=0,57,
if({view.params.id_Line}=3,41,-1))

So it is something to do with string and integer, but I don’t understand why there is a difference between designer display and Chrome display.

I am assuming that the id_Line is a URL parameter. These will be a string value at run time. In the designer you have to manually set them, and so I’m guessing you just typed in the number 3 which was converted to an integer.

This is why the expression with string literals works in chrome but not the designer. Because 3 is not equivalent to ‘3’

2 options:

  1. Use string literals (quotation marks) when entering the value in the designer so the designer knows the value is a string.

  2. Use toInt() in your expression to convert the parameter to an integer type.

1 Like

This is what’s coming as params
image

It’s just an factor for DB query to pick the right tables.
So in my opinion, 3 is an int. So in both cases this option should work. But it working in designer preview but not in chrome.

if({view.params.id_Line}=0,57,
if({view.params.id_Line}=3,41,-1))

This may be your opinion, but it doesn't change the fact that anything passed through the URL can only be a string.

Your expression works in the designer because when you just type in the number 3 the designer converts it to an integer. In chrome the parameter is a string and so your expression returns through the false path. In this case -1.

In the designer change the value of id_Line to '3' and change the expression to this:

if({view.params.id_Line} = '0', 57,
if({view.params.id_Line} = '3',41,-1))

Then it will work in both places.

2 Likes

Thanks Irose

This solved the problem

if(toString({view.params.id_Line})='0',57,
if(toString({view.params.id_Line})='3',41,-1))