Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to skip lines in Smartform output if field is blank

Former Member
0 Kudos

Hi, I have a question on Smartform output. I am trying to print addresses in a certain format as required by the business. The format is as follows.

Name1,

Name2,

Str_suppl1, Str_suppl2,

Street,

City1, Region, Post_code1, Country

However, if there is a blank field, I do not want a blank/empty line in the address when output. At the moment, I am populating a structure with the necessary address fields, then I am using the following code in a text element.

&gs_adrc_lines-line1&

&gs_adrc_lines-line2&

&gs_adrc_lines-line3&

&gs_adrc_lines-line4&

&gs_adrc_lines-line5&

&gs_adrc_lines-line6&

Basically, I want to avoid the following issue when outputting an address if a field (name2 for example) is missing:

Example Company,

Big Warehouse, Euro Business Park,

Carver street,

Chicago, IL, 098 765, USA

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sean,


You should divide this text element to 6 small text element, each one hold a value, then add 'Condition' like @Tharaka said.


regards,

Archer

3 REPLIES 3

tharaka_fernando
Contributor
0 Kudos

Hi Sean,

You can maintain a condition for displaying .

Insert your logic there like;

if <name2_val> <> ''

Thanks

Tharaka

Former Member
0 Kudos

Hi Sean,


You should divide this text element to 6 small text element, each one hold a value, then add 'Condition' like @Tharaka said.


regards,

Archer

0 Kudos

Thank you. I was looking for a way to do it within one text element but it seems to be impossible. Your way is the best alternative.