Editing a form's URL

8 Comments

  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Amy :)

    添加这个鳕鱼e at the bottom of script.js file:

    document.querySelector("option[data-url='https://xyz.zendesk.com/hc/en-us/requests/new?ticket_form_id=#######']").setAttribute("data-url", "google.com");

    Note: Removegoogle.com

    from the code

    setAttribute("data-url", "google.com");

    and add your URL which you want like this

    https://xyz.zendesk.com/hc/en-us/requests/new?ticket_form_id=#######__newword

    Remove this URL

    https://xyz.zendesk.com/hc/en-us/requests/new?ticket_form_id=#######

    From the code

    ("option[data-url='https://xyz.zendesk.com/hc/en-us/requests/new?ticket_form_id=#######']")

    and add your form URL which you wanna update

    Thanks

    0
  • Amy Giella

    Hi Ifra,

    Thanks so much for the quick reply. I did this, but that URL now takes me to the "Submit a request" screen with the dropdown to select which form to fill out. Even when I click on the form with the edited URL, I am looped back to this page and cannot fill out the form. Is there a way for the URL to go directly to the form itself?

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    I know because you can't edit the original URL which comes from backend. If you edit the original url it will create bug. You asked that's why I shared the trick.

    0
  • Amy Giella

    If I understand this correctly, you're saying it's possible to change the original URL with the code you initially provided, but it introduces a bug and there is no fix for the bug. So this would not be a workable solution.

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    @Amy Giella, actually the URLs in the helpcenter come from backend I means URLs defined by the developers, On my behalf you can't change the default URLs.

    0
  • Sebastian Carvajal

    Amy Giellahello,
    I have had the same need this week to modify the URL for UX issues, I did it with the following script:

    (函数cambiarUrl () {
    if(document.URL.indexOf("#########") != -1) { //modify the ID of your form #####.
    const state = { 'user': 'guest' }
    const title = ''
    const url = 'https://xyz.zendesk.com/hc/en-us/requests/new?ticket_form_id=#######__newword' // write here the url that you want to be seen.
    history.replaceState(state, title, url);
    }
    })
    ();

    Since we are modifying the user's browsing history, you must take into account that this is not an existing URL, so if the user tries to search for it directly, he will get an error not found, so I suggest you handle this error.

    I hope my idea helps you.

    1
  • Amy Giella

    Thanks so much,Sebastian! This got us a step closer to where we need to be.

    1
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Thanks for sharing the trick @塞巴斯蒂安:)

    0

Pleasesign into leave a comment.

Powered by Zendesk