Brian Dunning's FileMaker Custom Functions

WrapupLine ( test ; lineheader, linedata )

If data exists for a field, give it a bold label and show it.

  Average rating: 4.5 (22 votes) Log in to vote

Dwayne Wright   Dwayne Wright - Show more from this author
Dwayne Wright
http://thepracticalba.com

Share on Facebook Share on Twitter

  Sample input:
= field name<br> <br> Record 1<br> <Name> Dwayne<br> <Title> Dev<br> <br> Record 2<br> <Name> Jane Doe<br> <Title> (null) </div> </div> <div class="codewrapper">  Sample output:<br> <div class="code"> Record 1<br> Name: Dwayne<br> Title: Dev<br> <br> Record 2<br> Name: Jane Doe </div> </div> </div> <div style="clear:both;"></div> <p>  Function definition:<span class="grayital"> (Copy & paste into FileMaker's Edit Custom Function window)</span> </p> <textarea name="textarea" class="codearea" readonly id="textarea" style="height: 250px;">If ( IsEmpty(test) ; "" ; "ΒΆ" & TextStyleAdd ( lineheader & ": " ; Bold ) & linedata ) // Brought to you by Dwayne Wright - dwaynewright.com</textarea> <button id="copyBlock" class="cool_button">Click to copy</button> <span id="copyAnswer" class="redital"></span> <script type="text/javascript"> var textarea = document.getElementById( "textarea" ); var answer = document.getElementById( "copyAnswer" ); var copy = document.getElementById( "copyBlock" ); copy.addEventListener( 'click', function ( e ) { textarea.select(); try { var ok = document.execCommand( 'copy' ); if ( ok ) answer.innerHTML = 'Copied'; else answer.innerHTML = 'Unable to copy'; } catch ( err ) { answer.innerHTML = 'Unsupported Browser'; } } ); </script> <p style="word-wrap: break-word;"> You may want to concantenate multiple fields into a single text string with a boldly formated label in between. You don't want to show the label if the field is empty. </p> <p> </p> <h2>Comments</h2> <p><a href="/filemaker-custom-functions/account.php">Log in to post comments.</a> </p> <p> </p> <blockquote> <p class="redital">Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.</p> </blockquote> </div> <div id="support" style="max-width: 800px;"> <h3>Support this website.</h3> <p>This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:</p> <form action="https://www.paypal.com/donate" method="post" target="_top"> <div style="text-align: center"> <input type="hidden" name="hosted_button_id" value="UHA9QXALRVQDQ"> <input type="image" src="/filemaker-custom-functions/images/donate-button.png" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" width="258" height="73"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </div> </form> </div> </div> <div style="text-align: center;"> <footer>Other resources: <a href="https://www.zipwise.com/webservices">ZIP Code API</a> <a href="/sample-data">Sample data</a> <a href="mailto:brian@briandunning.com">Contact</a> </footer> </div><div id="donate_popup_30"> <div style="float: right;"><a href="javascript:void(0)" onClick="getElementById('donate_popup_30').style.display='none';getElementById('blackbottom').style.display='none';" class="cool_button" style="margin-top: 15px;">Nope</a></div> <h3>Support this website.</h3> <p>This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:</p> <form action="https://www.paypal.com/donate" method="post" target="_top"> <div style="text-align: center"> <input type="hidden" name="hosted_button_id" value="UHA9QXALRVQDQ"> <input type="image" src="/filemaker-custom-functions/images/donate-button.png" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" width="258" height="73"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </div> </form> </div> <div id="blackbottom"></div> </body> </html>