1

My "uniqueID" variable is outputting System.Data.DataRow[]. I'm trying to display the value on the page upon success.

<div class="container">
    <div class="row">
        <div class="col-md-6 col-md-offset-3 col-sm-12">
        %%[
            if RequestParameter("submitted") == "submitted" then

                var @email, @fullName, @accountNumber,
               @checkAccountNumber, @numRows, @checkDE, @deNumRows, @createDeRecord,
                @success, @fail, @uniqueID

                set @fullName = RequestParameter('fullName')

                set @email = RequestParameter('email')

                set @accountNumber = RequestParameter('accountNumber')

                set @checkAccountNumber = LookupRows('Unique_ID', 'AccountNumber', @accountNumber)

                set @numRows = RowCount(LookupRows('Unique_ID','AccountNumber',@accountNumber))

                set @checkDE = LookupRows('Unique_ID_Form_Submissions', 'EmailAddress', @email)

                set @uniqueID = LookupRows('Unique_ID', 'UniqueID', @accountNumber)

                set @deNumRows =  RowCount(LookupRows('Unique_ID_Form_Submissions', 'EmailAddress', @email))
                if @numRows > 0 then
                    set @success = 'I found your Unique ID'

                 elseif @numRows == 0 then

                     set @fail = 'I did not find your Account#'

                elseif @deNumRows > 0 then

                    set @duplicatedFound = 'You have already submitted your information.'

                endif
            endif
        endif
    endif
    ]%%

        <p id="success" style="color: green; font-family: arial, san-serif; font-size: 20px; font-weight: bold;">%%=v(@success)=%% %%=v(@uniqueID)=%%</p>  
        <p id="fail" style="color: red; font-family: arial, san-serif; font-size: 20px; font-weight: bold;">%%=v(@fail)=%%</p>
        </div>
    </div>
</div>
  • I've taken the liberty of re-formatting your markup/ampscript to give people a better chance at understanding your issue. Blockquotes (lines starting with >) generally isn't the right formatting tool to use when code is involved. Instead, I've used a code block, and tried to make your indentation consistent. Formatting as a code block means putting at least 4 blank spaces at the start of each line. The easy way to do that is to highlight your code/markup and press the {} button (or ctrl + k / cmd + k) – Derek F Jun 18 at 15:27
  • Thanks Derek. I feel like I'm close on this one. The AMPscript is successfully finding the right Account#, now I just need to display the Unique that is in the same row as the specific Account #. – JFH Jun 18 at 15:30
  • Should I be doing a Lookup and not a LookupRows to find my Unique ID based off of the Account# in the same row? – JFH Jun 18 at 16:52
0

I fixed it. I needed to use a straight Lookup not a LookupRow

set @uniqueID = Lookup('myQ_My_Dealer_Unique_ID', 'UniqueID', 'AccountNumber',@accountNumber)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.