Extract the subset of data in the query string

Hi all

I am using query strings in Eloqua for some time and found the implementation of them quite simple. I recently ran well across a scenario where it is not set up as a standard string.

The URL ends up looking like this:

http://Sub.domain.com/LP=123/?var=AB-business-_-AB-BusinessAB-_-TRK1AB23_hm_comp2-e_abcdefg_s

The 'TRK1AB23' is the component I want to extract and place in a field.

When I use the following code, I find myself everything of value, I want to pull all the way to the end of the string. What should I do to this code to retrieve only the characters that I need?

function getQueryStringParamValue (strQStrParam) {}

strURL var = document.location.href;

var strQStrParamValue = "";

If (strURL.indexOf('?')! = - 1) {}

strQStrParamValue = strURL.substr (strURL.indexOf('?') + 1);

If (strQStrParamValue.indexOf (strQStrParam)! = - 1) {}

strQStrParamValue = strQStrParamValue.substr (strQStrParamValue.indexOf (strQStrParam));

strQStrParamValue = strQStrParamValue.substr (strQStrParamValue.indexOf ('TRK') + 1);

If (strQStrParamValue.indexOf('&')! = - 1) strQStrParamValue = strQStrParamValue.substr (0, strQStrParamValue.indexOf ('&'));

Return strQStrParamValue;

} else {}

strQStrParamValue = defaultHiddenFieldNameValue;

Return strQStrParamValue;

}

} else {}

strQStrParamValue = defaultHiddenFieldNameValue;

Return strQStrParamValue;

}

}

Insert here the name of the form

var form = 'generic ';

function setCampaign() {}

var elqForm = return [form];

Repeat for each field to be completed

elqForm.elements ['singleLineText'] .value = getQueryStringParamValue ('var');

}

Window.OnLoad = setCampaign;

< /script >

Egan,

Your answer actually has helped me tremendously. I learned to look closer the code and found that it was an option of substring. I changed the substring to look at the first three characters of the code (which are always consistent) and then adjusted to shoot only the eight characters containing the code.

It is not the prettiest or most appropriate code but it does exactly what I need to!

Tags: Marketers

Similar Questions

  • How to store the query string value in the scope of the session in webcenter spaces?

    Hello

    I want to store the query string value (which is given from URL) in the sessionScope variable. According to the value of sessionScope beacause I went some components inside my taskflow. Can someone help me how to store this value in the scope of the session. I use webcenter spaces for my application development.

    Thank you

    Ashok.

    Please see the article below

    How to pass a parameter of argument the query URL to a parameter input workflow? (Doc ID 1545808.1).

  • You can control a URL in eloqua to add to the query string?

    If I insert a URL in an email, I can't stop eloqua to add additional query string parameters in eloqua.

    I want to make this happen because the URL doesn't seem to work if we add an extra parameter using the query string.

    I had a similar problem recently, and even turn off the tracking doesn't seem to help.  I finally decided to use a shortened URL (bit.ly) and it worked for me.

  • Problems with the primary key of the query string

    Moving from asp to php, to work with David Power's book: The Essential Guide to Dreamweaver CS4 with CSS, AJAX, and PHP.  Recycling of my brain, so starting from scratch in the learning process.

    Everything was going perfectly until I tried to add the primary key of a record in a query string.  I compared my code with the example code for the book, and everything matches.  When previewing the page in my browser and hover over the link which must pass the main code on the next page, the query string does not appear correctly.  It shows user_id = but no figure shows, as it is supposed to.  www.webpage.com/update_user.php?user_id=

    Here is my code: (Please note, <>have been removed, as I was unable to find a way view the code in the correct way here (copy/paste was doesn't work do not, nor insert syntax))

    ? PHP {?}

    ? PHP echo $row_listUser ['family_name'];? PHP echo $row_listUser ["FirstName"];?

    ? PHP echo $row_listUser ['username'];?       ? PHP echo $row_listUser ["admin_priv"];?

    a href = "update_user.php? user_id =? php echo $row_listUser ['user_id'];?" "Edit / has

    a href = "delete_user.php? user_id =? php echo $row_listUser ['user_id'];?" ' Delete / has

    ? PHP} while ($row_listUser = mysql_fetch_assoc ($listUser));?

    Any ideas that could help me understand why this part does not in particular would be greatly appreciated.  Writing to the database worked perfectly, I see that there are numbers in the database as user_id, and it is defined as my primary key in the configuration database.  Such a simple process that is causing me headaches!

    Thank you

    You have the code to request a copy in your folder:

    $query_listUser = 'SELECT user_id, username, first_name, family_name, admin_priv from users ORDER BY family_name ASC';

    $listUser = mysql_query ($query_listUser, $connSCFDIR) or die (mysql_error ());

    $row_listUser = mysql_fetch_assoc ($listUser);

    $totalRows_listUser = mysql_num_rows ($listUser);

    $query_listUser = 'SELECT username, first_name, family_name, admin_priv from users ORDER BY family_name ASC';

    $listUser = mysql_query ($query_listUser, $connSCFDIR) or die (mysql_error ());

    $row_listUser = mysql_fetch_assoc ($listUser);

    The $listUser table will contain the results of the second query, which does not include the field user_id. delete the redundant code.

  • PHP, handling # in a passage of the string in the query string

    I'm new to PHP the world ASP. I'm working on a shopping cart where, I'm passing the name of the item through the query string in the processcart.php file. It works fine until I have put a sign # in the name of the element. Is there a good way to manage the channels with signs # among them.

    David

    DEPearson wrote:
    > I'm new to PHP the world ASP. I'm working on a shopping cart where I
    > pass the option through the query string name in the processcart.php file. It works
    > great until I have put a sign # in the name of the element. Is there a good way to manage
    > strings containing signs # among them.

    PHP can handle # in a string without problems. The error that you are
    manufacturing must pass # by a query string. In a URL, # indicates a
    element named inside the page. To use # as a character who is preserved
    as a literal value, you need to urlencode. You can either do
    with the urlencoded function. It is probably easier to use the
    URL directly: %23 represents #.

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Example to use the query string in the Oracle Access Manager policy.

    Hi all

    Can is there any one please tell me what is the value of the query string and Query String Variable OAM political?

    If possible, please explain with an example of the sample.

    Thanks in advance.

    Siva NAKI.

    Let's say I have an application that has logout URL as http://abc.com/app.cgi?function=logout&user=LOGGED_USER.
    In this case, logged in user will always be different, but you want the user to sign out when this URL is hit. In this scenario, you can use query string variables and specify the function = disconnect it.

    In other scenarios where you know all the query parameters and you want to protect these URLs then the query string can be used.

    Thank you
    Kiran Thakkar

  • How to get the query of the region "PL/SQL function body returns the query string"?

    Hello

    is it possible to get the query string from the region of type "PL/SQL function body returns the query string"?

    I can get the definition of the region as a PL/SQL procedure, but I am interested in the returned query. I tried to write something like

    < pre > v_return_query: = «...» » ;
    : P49_QUERY: = v_return_query;
    Return v_return_query; < / pre >

    to save the return on hidden item P49_QUERY string, but it does not work. I get the error message: ERR-1002 cannot find the item for the "P49_QUERY" element ID in the application '4000 '.

    Kind regards
    Przemek

    If you need to make reference to a page element in the block then you can use this type of control to avoid having to use generic column names:

    if apex_application.get_current_flow_sgid(:APP_ID) = apex_application.get_sgid then-- runtime  :P9_SQL := vSQL;else-- design time  null;end if;
    

    But if all you want to do is capture the SQL debugging you can take all the references element in the block and use the insert statement (in a debug table) as I showed earlier.

    Scott

  • Need help with the query string manipulation

    Hello

    With the help of 10.1.0.4.2

    Given a table called PREFIX_CODES that contains a column called PREFIX_CODE
    with the following data:

    PREFIX_CODE - VARCHAR2 (20)
    -------------------
    AAA
    BENAMER
    CARTER

    and another table called SUBSCRIBERS with a column called SUBSCRIBER_ID
    with the following data:

    SUBSCRIBER_ID - VARCHAR2 (30)
    ---------------------
    BBBB-123456
    AAA-444444
    DD-2222222
    EEEE-888888

    Is there a query that will pull all the SUBSCRIBER_ID that begin with
    each of the PREFIX_CODES? The following query is not valid, but it
    This will give you an idea of what I'm trying to do:

    SELECT SUBSCRIBER_ID
    SUBSCRIBERS
    WHERE AS SUBSCRIBER_ID (SELECT PREFIX_CODE |) » %'
    OF PREFIX_CODES)

    Using the data from above, I would like that the query to return:

    BBBB-123456
    AAA-444444

    Thanks for your help!

    Hello

    Welcome to the forum!

    You were on the right track. To find if a given subscriber corresponds to any prefix_code, you can do an EXISTS subquery:

    SELECT     subscriber_id
    FROM     subsribers     s
    WHERE     EXISTS ( SELECT  NULL
                      FROM      prefix_codes
               WHERE      s.subscriber_id     LIKE prefix_code || '%'
                )
    ;
    

    This will tell you if at least a prefix code. It won't tell you exactly how many, or what they were.
    Your message, I'm guessing that there may be more than one, and you can deduct the subscriber_id itself, then the above query should work for you.

  • Bug: APEX_COLLECTION. CREATE_COLLECTION_FROM_QUERY_B change the query string

    Hi APEX Dev Team.

    I found a bug (or I don't know how to get around unexpected behavior) in APEX_COLLECTION. CREATE_COLLECTION_FROM_QUERY_B. I think that it also applies to the CREATE_COLLECTION_FROM_QUERY.

    What's happening: some strings are replaced in the query, I pass into the function. for example '22% ' is replaced by a white. It is not good if I have a query like this:
    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%22306%';
    This returns no rows in the collection. If I run this query in SQL Developer she returns 5 rows.

    When I change the declaration subsequently, it returns 5 rows in the collection.
    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%2306%';
    Trace shows me, the first SELECT statement is replaced by
    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE ' 306%';
    Which is obviously false :-)

    The changes seem to be limited to 22%, I found no other characters encoding URLS that are replaced in the query.

    Please fix, as I can't find any workaround.

    Thank you
    Peter

    -----
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

    Hi Peter,.

    Thanks for reporting this. This seems to be a legacy logic which is no longer necessary (the logic to replace the string '22% '). I corrected it to Application Express 4.1.

    To work around the problem, you can concatenate this string in your application, allowing you to avoid this logic. For example,.

    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%2 '. 2306 ' %';

    Thanks again.

    Joel

  • What is the limit on the query string / post / URL parameters?

    Is there a limitation on the url parameters sent in the post method?

    Thanks in advance.

    Chandra, I'm afraid that I don't know what you just said.

    URL parameters, as far as I know, are not encrypted even in an HTTPS Exchange, because they are considered as part of the URL, only not part of the message.  The body of the message (i.e. POST), on the other hand, it's protected.

    I suggest that you send the query parameters in JSON format, just as you could do it with AJAX.  It is a well designed and well understood Protocol with good support on the client and server side.  (XML is also the same.)  This will put the exchange of information in the body of the message (encrypted), and it also will allow you to send and receive information structured structs and lists and tables and so - on.

    You still need to be aware of the size of the messages, but not nearly as much with the URL string.

    Whenever you feel that you could be "pushing a limit", it is time to think that "there must be a better way to do it."

  • splitting the query string values

    all,
    I do not remember this, but my problem is that I have a collection of forwarded to my query as string values "X 234234: 23466 X: X 03287: X 457675 ', so my request should be able to divide each data value and use in the filter as below,

    Select * from emp where EmpID in ("X 234234: 23466 X: X 03287: X 457675")

    so, how can I divide each individual value and pass through the filter?

    Thank you.

    SELECT trim(x.column_value.extract('e/text () ')) CLO
    Of
    TABLE (XMLSEQUENCE (XMLTYPE (""
    || REPLACE ('1:2:3:4:6:7:8',': ','
    ')
    || ((("
    ").extract('e/e'))) x

    Try customizing the syntax above using the column in the function replace instead of my hard-coded string and pass it to the filter predicate using an in operator.

    Edited by: Chandrakaanth Ramamurthy on April 25, 2013 16:29

  • extract the partial string of the string in oracle

    Hello friends,

    I have a string like this

    var str = "/ G/CNH/CNHCornerstone/currentCode/data/Working/Images/ModelImages/png/7402203E-607D-E111-9CA5-005056875BD6.png"

    I want to extract only 7402203E-607D-E111-9CA5-005056875BD6 of the chain.

    Please let me know how to implement this...

    Thank you/kumar

    Published by: kumar73 on April 10, 2012 12:34

    One more using REGEXP_SUBSTR... This should be faster (than the previous REGEXP) because the REGULAR expression is simpler and extracts only the GUID.

    select regexp_substr('/G/CNH/CNHCornerstone/currentCode/data/Working/Images/ModelImages/png/7402203E-607D-E111-9CA5-005056875BD6.png', '[0-9A-F]{8,8}-[0-9A-F]{4,4}-[0-9A-F]{4,4}-[0-9A-F]{4,4}-[0-9A-F]{12,12}') from dual

    You need however to reference that. In addition, it assumes that only the file name is a GUID. If a drectory name is a GUID, then he will find out who "accidentally" instead.

    Published by: dayneo on June 6, 2012 07:35

  • Extract the given string a String between double quotes

    Hey guys,.

    I am doing a project open source to help lovers of ADS - B to store data on Oracle Database XE (11.2.0.2)

    I need to retrieve a string, but I didn't know how, please can someone help me.

    Chain: [{'id': 'PR - GIG', 'label': "PR-CONCERT - E47EB2 - BS Airlines - Boeing 737 - 73 S (29077)", "value": 'PR - GIG' "}]

    KeyString: "label".

    Output: ' PR-CONCERT - E47EB2 - BS Airlines - Boeing 737 - 73 S (29077) '


    And if possible put this string in multiple strings

    String1: PR-GIG

    Channel 2: E47EB2

    String3: BS Airlines

    String4: Boeing 737 - 73 S

    String5: 29077

    Thanks for the help.

    Select x.*

    t,.

    XMLTable)

    "ora: tokenize($s,"-").

    from regexp_substr (str,'"label": "([^"]+) "', 1,1,null, 1) as"s ".

    ) x

    /

    COLUMN_VALUE
    -------------------------
    PR - GIG
    E47EB2
    BS Airlines
    Boeing 737 - 73S (29077)

    SQL >

    SY.

  • required to break the query string

    Hi all

    Can do anything please help me write a query for the following rerquirement.

    I / P:

    NAME
    -------
    MIKE
    ...
    ...


    O/P:

    MIKE should appear as

    NAME:
    -------
    M
    I have
    K
    E

    Thank you.

    Hello

    See {message identifier: = 10095021} in several ways.

  • How to extract the response JSON data

    Hi all

    I get the following response from the server.

    "
    "PAO - ENV ="http://schemas.xmlsoap.org/soap/envelope/"xmlns:ns1 =" urn: soapservice "container ="http://www.w3.org/2001/XMLSchema"xmlns: xsi ="http://www.w3.org/2001/XMLS
    "Chema-instance" xmlnsPAO - ENC = "http://schemas.xmlsoap.org/soap/encoding/" SOAP - ENV:encodingStyle ="http://schemas.xmlsoap.org/soap/encoding/" > ""<>
    tAdvertismentReturn xsi: type = "xsd: String" > {'MSG1': '1', "MSG2": "success", "DA..."}

    Now, I want to create a QVariantList using JsonDataAccess.

    If I manually extract the JSON string after that

    downloadData = jda.loadFromBuffer (data);

    so I'm able to get the data.

    Without extraction like that how can I take the response JSON data?

    Thank you.

    Thanks for your time,

    Here's my problem how to build a soap with the response object.

    I solved this problem with the help of the example of the weather.

    Thank you.

Maybe you are looking for