Skip to main content
kavyam0002
July 4, 2022
Solved

New line

  • July 4, 2022
  • 5 replies
  • 0 views

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 

    Best answer by stefanhelzle0001

    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
    July 4, 2022

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

    kavyam0002
    July 4, 2022

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

    stefanhelzle0001
    Brainy
    July 4, 2022

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

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

    stewart.burchell
    July 4, 2022

    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
    July 4, 2022

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