Getting Started

Expand all | Collapse all

Text Passed to URL Truncated at Space

  • 1.  Text Passed to URL Truncated at Space

    Posted 02-19-2020 15:01
    URLRoot() & "db/" & [_DBID_ASSETS] & "?a=q&qid=31&nv=2&v0=" &[Name];

    For example, if Name above is "Lastname, Firstname" then the url above would be:
    https://xxx.quickbase.com/db/bp6itgamh?a=q&qid=31&nv=2&v0=Lastname,

    How to get the entire string to come through?

    In addition, if a string is used without a space, for example "Lastname,Firstname" then the url is:

    https://xxx.quickbase.com/db/bp6itgamh?a=q&qid=31&nv=2&v0=Lastname,Firstname'
    Note the trailing apostrophe. Makes for data corruption.
    Thanks in advance.
    Edward


    Quick Base Error
    Quickbase remove preview
    Quick Base Error
    Quick Base is a web-site that lets you select, customize, and share online workgroup applications. The application you are using right now is powered by Quick Base. Chances are that your organization has purchased the Quick Base service, in which case you might be able to build and deploy your own web application for little or no additional cost.
    View this on Quickbase >


    Quick Base Error
    Quickbase remove preview
    Quick Base Error
    Quick Base is a web-site that lets you select, customize, and share online workgroup applications. The application you are using right now is powered by Quick Base. Chances are that your organization has purchased the Quick Base service, in which case you might be able to build and deploy your own web application for little or no additional cost.
    View this on Quickbase >



    ------------------------------
    Edward Abrahim
    ------------------------------


  • 2.  RE: Text Passed to URL Truncated at Space

    Posted 02-19-2020 15:14
    Edited by Austin K 02-19-2020 15:14
    It is best practice to run the fields through the URLEncode function if they will be included in a URL.

    URLRoot() & "db/" & [_DBID_ASSETS] & "?a=q&qid=31&nv=2&v0=" &URLEncode([Name]);

    That should come out correctly for you now no matter how the name is set up.


  • 3.  RE: Text Passed to URL Truncated at Space

    Posted 02-20-2020 08:50
    Thanks for the response. URLEncode does solve the issue of the spaces so the text is no longer being truncated there. However, there is still the second issue of an appended apostrophe.
    Input:
    URLRoot() & "db/" & [_DBID_ASSETS] & "?a=q&qid=31&nv=2&v0=" &URLEncode([Name]);

    Output:
    https://xxx.quickbase.com/db/bp6itgamh?a=q&qid=31&nv=2&v0=Lastname,Firstname'

    Should be:
    https://xxx.quickbase.com/db/bp6itgamh?a=q&qid=31&nv=2&v0=Lastname,Firstname
    Thanks in advance again,
    Edward

    ------------------------------
    Edward Abrahim
    ------------------------------



  • 4.  RE: Text Passed to URL Truncated at Space

    Posted 02-20-2020 09:30
    The output I see with the formula I gave is this:

    https://xxxx.quickbase.com/db/xxxxxxxx?a=q&qid=31&nv=2&v0=Syrup%2C%20Maple

    The %2C is the comma and %20 is the space. There should not be a trailing apostrophe. I made the above formula using UserToName(user()) to grab the current user but you could use any number of things for that.

    I notice that you have a semi colon at the end of your input line so I assume this is being used in a larger formula as a variable. I think in order to help further I would need to see that larger formula as I am going to guess there is some errant apostrophe in there. That is the only place I can think you may be getting that from. Unless the data was bad in the first place and the name actually contained it already.


  • 5.  RE: Text Passed to URL Truncated at Space

    Posted 02-20-2020 10:05
    Yes, the semicolon is required at the end of each line of code, maybe because of javascript. Here is the entire formula:

    // Images
    var text IMG = "<img src=https://images.quickbase.com/si/48/045-lock.png>";
    // QID
    var text QID =
    URLRoot() & "db/" & [_DBID_ASSETS] & "?a=q&qid=31&nv=2&v0=" &URLEncode([Name]);
    "<a href=" & $QID & "' title=\"Pseudo Report Link\">" & $IMG & "</a>"

    Thanks,
    Edward

    ------------------------------
    Edward Abrahim
    ------------------------------



  • 6.  RE: Text Passed to URL Truncated at Space

    Posted 02-20-2020 10:31
    Looks like this spot? There is an extra apostrophe there there I do not see a match for. Removing it does not change the formula as that is a text section. I would bet that is the issue.

    "' title=\" 


  • 7.  RE: Text Passed to URL Truncated at Space

    Posted 02-20-2020 10:45
    Yes, that's it. No idea how it got in there. Could have been on the original copied text. Makes sense as it is appended to the $QID test.  Great, thanks for your help.

    ------------------------------
    Edward Abrahim
    ------------------------------