6 Replies Latest reply on Jul 9, 2018 11:01 AM by Nicholas Harberg

    Conditionally load input field based on database entry

    Nicholas Harberg

      Hello everyone,


      Goal : I have a form with a checkbox that asks permission to store the user's data. If they have selected 'yes' I don't want to show the checkbox on future forms or page visits.


      What I've tried:

      1. Check if there is a munchkin cookie in the users browser.

      2. If there is, make an API call to the lead db to check the value of the db field 'Consent_to_Processing__c'.

      3. The input row is hidden with CSS, but if the API call returns 'false' or 'null', then the input row will be displayed.


      Current problems I'm trying to solve for:

      1. Can I conditionally load the input based on the API call value?

      2. I'm trying to not have to load the form with JS because I don't our Automation team to be able to embed different forms without having to get the JS file updated.

      3. There are timing problems currently with the form sometimes loading after the API call is finished, so the DOM element to unhide doesn't exist when the API value is checked.


      Any help from the community would be very helpful. Thanks.