NetSuite Empty Fields and SQL import

Answered

Comments

3 comments

  • Official comment
    Matt Graney Chief Product Officer
    Engaged
    Answer Pro
    Top Contributor

    Glad that worked for you, Jim. That, and more! There are a wide range of macro functions you can use, see https://docs.celigo.com/hc/en-us/articles/360039326071-Handlebars-Library

     

    -Matt

  • Matt Graney Chief Product Officer
    Engaged
    Answer Pro
    Top Contributor

    Hi Jim,

    You wrote:

         If I'm using a map, I can specify options if the data is missing, but there's no way to do that in an SQL query. 

    There is in fact a way to do that. In your SQL query builder for the import you can test for missing fields using the {{#if}} handlebar function. If for example you were expecting a field called optionalField, you can test for it as follows, and use its value if it's present, and otherwise use a default.

    {{#if data.optionalField}}{{data.optionalField}}{{else}}My Default Value{{/if}}

    Hope that helps!

    Matt

     

    0
  • PSA Admin

     

    Thank you!  I didn't realize handlebar expressions were evaluated in that context beyond simple field substitutions.

    Jim

    0

Please sign in to leave a comment.