How to show specific fields based on 'Get Referrer' widget value?

  • Profile Image
    AJH89
    Asked on November 15, 2018 at 05:04 AM

    Hi.. 

    Would it be possible to use the URL referral widget in a condition? 

    For example, if a user were to arrive from a specific URL could we determine what fields they are able to view? 

  • Profile Image
    Victoria_K
    Answered on November 15, 2018 at 09:31 AM

    Yes, this should be possible to check the value of 'Get Referrer' widget conditionally. I would suggest to check if widget field 'contains' or 'starts with' some value:

    154229225016-28-46.png

    Related guide: How-to-Show-or-Hide-Fields-Base-on-User-s-Answer

    We will gladly assist if you need any further help. 

  • Profile Image
    AJH89
    Answered on November 15, 2018 at 10:39 AM

    You can select 'contains' and add a URL but is the referral information available in real time to carry out the condition? 

    i.e. show fields that are relevant to that condition

    or, is the referral information only available after the form has been submitted. Therefore, only available in the report. 

  • Profile Image
    Victoria_K
    Answered on November 15, 2018 at 12:17 PM

    Yes, from my tests it should be working, referrer value is on form in real time. At least, I was able to hide Submit button based on 'contains' condition.

    If you have already started working on a form and need more help, we can take a look.

  • Profile Image
    AJH89
    Answered on November 16, 2018 at 10:13 AM

    Thanks. It seems to work for pages the form is embedded on... With that in mind does the Get Referrer widget only track the URL the form is on?

    I.e we want to set up a condition based on the linking page. So, if the form was linked to from this page https://qualifications.pearson.com/en/qualifications/edexcel-gcses/history-2016/switch-to-pearson.html could we set a condition based on that URL? 


  • Profile Image
    Victoria_K
    Answered on November 16, 2018 at 11:34 AM

    If respondents clicks forms direct link on that web page, it should work properly, but I am not sure if embedded form can fetch that value correctly since it runs inside of an iframe. 

    If you could provide some more information on the flow, it would help us to check for other possible solutions for you.

  • Profile Image
    Victoria_K
    Answered on November 16, 2018 at 11:43 AM

     I can see this button which is linked to embedded form:

    154238618618-35-47.png

    You could pass parameters via URL to the embedded form's hidden field with this one and other links. For example, the link on the screenshot above would be the following:

    https://qualifications.pearson.com/en/forms/ito-gcse-history.html??firstName=test 

    Another link, would pass different parameter to the field on a form. 

    Then, on a form you could set up conditional logic based on the value passed.

    If you decide to try this out, please embed the form using iframe code: Getting-the-Form-iFrame-Code

    Hope this helps! But, please get back to us if you need further assistance.