0 Replies Latest reply on Oct 14, 2014 10:50 AM by kent.heberling

    How do I use userProperty Soy Function

    kent.heberling

      I am trying to read an extended user property and use it to manipulate some UI items in soy. This property may or may not exist on a user, so I am attempting to use some conditional checks.

       

      The basic assignment works when the property does exist:

      {let $openPreference}{userProperty('ihs.gettingstarted.preference')}{/let}

       

      However, if the property does not exist, an ugly error results.

       

      Wrapping the whole block in the following at first seems to help, but will actually result in JS syntax errors regardless of whether the property is set.

      {if userProperty('ihs.gettingstarted.preference')}


      How can I achieve this? The basic goal would be:

      {if property exists}

           {let $openPreference}{userProperty('ihs.gettingstarted.preference')}{/let}

           {if $openPreference == 'show'}

                do stuff

           {/if}

      {/if}