0

i have created a data extension names as recordsDe. it have some record in it check picture and i want to display its all data my in cloud page.

like Record A1 | Record B1

Record A2 | Record B2

Record A3 | Record B3

Record A4 | Record B4

I have written a code like this

%%[

var @FieldA, @FieldB, @row, @rows, @rowCount, @i

set @rows = LookupRows("recordsDe"," ")/* What should i update here */

set @rowCount = rowcount(@rows)

if @rowCount > 0 then

for @i = 1 to @rowCount do

set @row = row(@rows, @i) 
set @FieldA = field(@row,"FieldA")
set @FieldB = field(@row,"FieldB")

]%%

    %%=v(@FieldA)=%% | %%=v(@FieldB)=%%

%%[ 

next @i 

endif

]%%

i don't have 3rd field in DE because i don't want to display FieldA and FieldB records by matching using 3rd field. So anyone please help me how to do this.

enter image description here

1 Answer 1

4

You need to have a 3rd column, which always has the same value, e.g. "1". Let's call this column: return. However possible, I will not recommend this, as you don't have any control of how many rows will be parsed.

But if you choose this approach, your LookupRows will look like this:

LookupRows("recordsDe","return","1")
3
  • Thanks for reply, Ya we can do it by 3rd column but i just looking for something like select DataExtension and print all its record. Commented Jul 12, 2019 at 8:52
  • 2
    This is the only viable way of doing so in AmpScript. Remember to mark the answer as accepted Commented Jul 12, 2019 at 8:54
  • Yeah, only other way to do it is via API or to a degree SSJS, which each have a 2500 record limit and are really bonkers solutions for something that can easily and much more efficiently be done with extra column in ampscript Commented Jul 12, 2019 at 23:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .