none
How to deal with spaces in parameters passed in URL, or, how to get rid of Quotation marks in parameters passed in URL

    Question

  • Im passing parameters to a newform.aspx in order to prepopulate some fields

    eg https://<site>Lists/Course%20feedback/NewForm.aspx?CourseTitle="Advanced Word 2016"&CourseDate="16 May 2019"

    The URL is being generated in a SPD 2013 workflow attached to another list, using existing fields from that list, and they have spaces in them. 

    In NewForm.aspx I am assigning them to parameters (source Query String) and then passing them to a label

    eg <asp:Label runat="server" text="{$TrainerParam}"></asp:Label>

    The parameters of course appear on the form with the quotation marks.

    Any ideas on the best way of removing them?

    Thanks.

    Friday, May 10, 2019 3:08 PM

All replies

  • Try to encode the URL.

    https://www.ascii.cl/url-encoding.htm

    NewForm.aspx?CourseTitle%3DAdvanced+Word+2016%26CourseDate%3D16+May+2019


    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    Monday, May 13, 2019 2:17 AM
  • Hi Justin

    Thanks for replying. 

    This is what is appearing on the form at the moment:

    Course title: "Advanced Word"

    Course date: "16 May 2019"

    If I encode it as you suggest, would this not mean that it would then appear on the the form like this?

    Course title: Advanced+Word

    Course title: 16+May+2019

    Also, the link is created using a variable assignment in a SharePoint workflow.  How would I go about encoding it from within the workflow?

    Thank you for your assistance.

    Tuesday, May 14, 2019 9:36 AM
  • Hi

    Try to replace + with 20%

    There should be an activity related to URL Encode in SharePoint Designer Workflow, try to find the 'BuildUri ' activity.


    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    Wednesday, May 15, 2019 3:19 AM
  • Hi Justin,

    And where can I find this "buildUri" activity in SharePoint Designer workflows ? Or is there a codeless activity for this ?

    Wednesday, May 15, 2019 11:19 AM
  • I don't have on premise environment now so I am not sure.

    If there is no some activities like url encoder by default, then I am afraid you need to use a 3rd party one or develop one by yourself.

    Waiting for someone to confirm this.


    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.


    Thursday, May 16, 2019 6:02 AM
  • Hi ,

    Has the problem been solved?

    If you think the replies are helpful to you, please remember to mark them as answers. It will help others who meet the similar question in this forum.

    Thank you for your understanding.

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, May 23, 2019 9:36 AM