Skip to main content
kavyam0002
Brainy
Jul 4, 2022 10:06 AM UTC
Solved

New line

HI 

here i have used <br> tag for new line now the issue is whether the values is present in limitamout or not it's going to new line/ breaking the line 

this is how the output looks like 

but whenever the data is empty then it shouldn't break the line 

how it can be done 

    stefanhelzle0001
    Brainy
    Jul 4, 2022 11:00 AM UTC

    I would recommend to use the concat function. But using & does not make a difference. Can your explain the issue?

    & if(condition, "
    ", "") &

    5 replies

    stefanhelzle0001
    Brainy
    Jul 4, 2022 10:51 AM UTC

    You will need to wrap the <br> tags into an if() condition, checking whether to line-break or not.

    kavyam0002
    Brainy
    Jul 4, 2022 10:55 AM UTC

    yeah, i have tried that but am using & to concat which is causing issue againg

    stefanhelzle0001
    Brainy
    Jul 4, 2022 11:00 AM UTC

    I would recommend to use the concat function. But using & does not make a difference. Can your explain the issue?

    & if(condition, "
    ", "") &

    stewart.burchell
    Employee
    Jul 4, 2022 11:11 AM UTC

    It does look like you have a lot of repetition in your expression. Could you not call a rule in an a!forEach() - once for each data item - and use that rule to determine whether a <br></br> is required or not?

    Also you seem to have many calls to a rule which looks like a Query Entity (given the name of the rule). This would be better if you called the Query Entity once for all of the items in one call, and then you can loop on the resultant data, determining if a<br></br> is required or not.

    kavyam0002
    Brainy
    Jul 4, 2022 12:47 PM UTC

    can you please let me know how can i write it in loop function?