Support » Plugin: Dynamics 365 Integration » Pass on hidden value

  • Resolved losatomsk

    (@losatomsk)


    Hi!

    Enjoying the plugin so far. It’s quite elegant to work with and set up. Nice work!
    I’m trying to do a specific thing and I’ve went through the information on the AlexaCRM site several times, but this feature I’m looking for isn’t available, or I’m too dumb to figure it out 🙂

    – What I’m trying to do:
    Publish a form on a wordpress site, that creates a lead.
    I want to populate the CRM field “Lead source” with “Website” and I want this value to be passed on to CRM… But I don’t want a visitor of the website to visibly see that field. We’re not trying to hide anything, it’s just that a visitor has no use of that information. And it’s just cleaner.

    – What I’ve done so far:
    Created a new CRM form, published it. Created the following shortcode:
    [msdyncrm_form entity=”lead” name=”Wordpress demo form” mode=”create” captcha=”false” redirect_url=http://www.scapta.com/thank-you/ default=”{subject: Aanvraag demo 4PS} {leadsourcecode:Website 4PS}”]

    I have hidden the field “leadsourcecode” from the form in CRM.

    Regenerated the metadata, refreshed the page.

    The field isn’t present in WordPress, but when I submit all the other fields, the leadsourcecode isn’t populated.

    If I unhide this field, all works well.

    – My conclusion?
    Am I correct that if the field isn’t present on the form in CRM OR is hidden, that the data is not passed on to CRM?

    It would be nice to be able to do this. The website we’re using is one of multiple sources and in a later stage, I want to be able to create marketing lists depending on that source. With the wordpress plugin, I was hoping to automate this.

    Is this possible, or am I missing something?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author alexacrm

    (@alexacrm)

    Hi @losatomsk,

    I don’t think you missed anything. As far as I remember, leadsourcecode is a lookup, the value would be an integer, not a string. Try that and let us know if value is still not set.

    Cheers
    AlexaCRM Support

    Did this work with an integer? I am looking at the same thing. Can you post the code for an integer?

    Plugin Author alexacrm

    (@alexacrm)

    Hi @jenn0014

    something like [msdyncrm_form entity="lead" name="web lead form" mode="create" ...default="{subject: Web demo lead capture}{foobar_age:42}"] should work for integers. If it doesn’t then let us know by posting your form shortcode and we’ll look into it.

    THanks
    AlexaCRM Team

    Hi @alexacrm

    When i try this i receives an error code:
    Warning: Property new_enquirytype of the lead entity must be a valid OptionSetValue of type new_lead_new_enquirytype in /var/sites/s/stepstirling.co.uk/public_html/wp-content/plugins/integration-dynamics/src/Shortcode/Form/FormInstance.php on line 574 in /var/sites/s/stepstirling.co.uk/public_html/wp-content/plugins/integration-dynamics/vendor/alexacrm/php-crm-toolkit/src/Entity.php on line 347

    the code i’m using is:
    [msdyncrm_form entity_name=’lead’ form_name=’leadership form’ mode=’create’ parameter_name=’contactid’ captcha=’true’ default=”{new_url:querystring.id}’” default=”{new_enquirytype:’5′}”]

    thanks

    Plugin Author alexacrm

    (@alexacrm)

    @jenn0014
    try setting the value without quotes, i.e.

    [msdyncrm_form entity_name='lead' form_name='leadership form' mode='create' parameter_name='contactid' captcha='true' default="{new_url:querystring.id}'" default="{new_enquirytype:5}"]

    • This reply was modified 5 years, 3 months ago by alexacrm.

    No,

    I am still receiving this message:

    Warning: Property new_enquirytype of the lead entity must be a valid OptionSetValue of type new_lead_new_enquirytype in /var/sites/s/stepstirling.co.uk/public_html/wp-content/plugins/integration-dynamics/src/Shortcode/Form/FormInstance.php on line 574 in /var/sites/s/stepstirling.co.uk/public_html/wp-content/plugins/integration-dynamics/vendor/alexacrm/php-crm-toolkit/src/Entity.php on line 347

    Plugin Author alexacrm

    (@alexacrm)

    @jenn0014

    1. Is it a global or local optionset?
    2. Option value 5 does exist, right? Seems to be a very strange number for a custom optionset – they are usually above 80,000. Can you attach a screenshot where this value is defined?

    Thanks
    AlexaCRM Team

    Hi Alexacm

    It is a global optionset.
    I think the value may have originally been a high value but someone has changed as they were doing code before when creating a flow. The flow has a code that shows: @equals(triggerBody()?[‘new_enquirytype’], bool(5))

    Wordpress doesn’t give me an option to attach a file or insert an image to this comment. I could email you a screenshot?

    Thanks again,
    Jenn

    Plugin Author alexacrm

    (@alexacrm)

    @jenn0014,

    no need for the screenshot at the moment. The possible values are available in the page source (since they are set by the dropdown), and they are, as expected, 100000000 and above. Try setting {new_enquirytype:100000005} which would set it to “Other”.

    Thanks
    AlexaCRM Team
    FYI: I doubt the flow code is working as expected.

    Hi Alexa,

    I have reformatted the value back to its original value which was 100000008. Although the flow was working but is not as vital as this form. I have inputted this value into the form as above. However, when I open the form there is no default value. Should this only be inputted once the form is filled in? If so can I hide from the user? My default for the URL also does not show by default?

    Thanks Jenn

    Plugin Author alexacrm

    (@alexacrm)

    Hi @jenn0014,

    I think I know why it’s not working. You cannot use multiple default attribute. If you want to specify multiple defaults, it should be done as following

    [msdyncrm_form entity_name='lead' form_name='leadership form' mode='create' captcha='true' default="{new_url:querystring.id}{new_enquirytype:100000008}"]

    Assuming new_url is a string, for new_url to work, it needs passed through the query string as a valid string. For example https://foobar.com/yourpage/?id=foobar.org

    Thanks

    • This reply was modified 5 years, 3 months ago by alexacrm.

    Hi @alexacrm

    This worked perfect!! One last question – can a field be hidden without being hidden on nthe dynamics form?

    Thanks
    Jenn

    Plugin Author alexacrm

    (@alexacrm)

    Hi @jenn0014

    you have two ways to handle it:

    1. Copy the form and maintain a separate form for online where the field is hidden
    2. Add css to hide the specific field at runtime

    Thanks
    AlexaCRM Team

    ok, I think CSS would work best. Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Pass on hidden value’ is closed to new replies.