Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

Invalid index (parameter2) Passed to row function. Index must be less than or equal to the row count -

$
0
0

I am trying to display 3 hotel contents in a for loop but I am getting the error while previewing only for specific contacts. Not able to solve this. Any help would be greatly appreciated.

This is my code.

``` SET @Rows = LookupRows('SWG_SR_HotelContent','version',@version,'LanguageCode',@LanguageCode)FOR @Counter = 1 to 3 DO                  SET @Row = Row(@Rows, @Counter)                  SET @HotelName = Field(@Row,'HotelName')                  SET @HotelCode = Field(@Row,'HotelCode')                  SET @DestinationName = Field(@Row,'DestinationName')                   SET @DestinationCountryName = Field(@Row,'DestinationCountryName')                    SET @StarRating = Field(@Row,'StarRating')                     SET @hotelDetail_collection = Field(@Row,'Collection')                     SET @hotelDetail_concept = Field(@Row,'Concept')                      SET @hotelDetail_hotelImages = Field(@Row,'HotelImages')                       SET @HotelOverview = Field(@Row,'HotelOverview')                       if IndexOf(@HotelOverview, "•") > 0 THEN                       SET @HotelOverviewRemovebullets = replace(@HotelOverview,"•"," ")                       ELSE IndexOf(@HotelOverview, "•") > 0 THEN                       SET @HotelOverviewRemovebullets = replace(@HotelOverview,"•"," ")           ENDIFVAR  @bullet1, @bullet2, @bullet, @rsIF IndexOf(@HotelOverviewRemovebullets, "<br>") > 0 THEN    SET @rs = BuildRowsetFromString(@HotelOverviewRemovebullets,'<br>')    SET @bullet1 = Field(Row(@rs,1),1)    SET @bullet2 = Field(Row(@rs,2),1)     SET @bullet3 = Field(Row(@rs,3),1)ENDIF                        SET @HotelLink = Field(@Row,'HotelLink')                         SET @HotelLink_CTA = CONCAT(@HotelLink,'?utm_source=mc-campaign&utm_medium=email&utm_campaign=swg_adhoc_search-retarget-journey-tf_20231218_en&utm_content=',@HotelCode,'-cta&utm_term=en&ajs_event=Email%20Link%20Clicked&ajs_uid=',SubscriberKey)                         SET @HotelLink_IMG = CONCAT(@HotelLink,'?utm_source=mc-campaign&utm_medium=email&utm_campaign=swg_adhoc_search-retarget-journey-tf_20231218_en&utm_content=',@HotelCode,'-img&utm_term=en&ajs_event=Email%20Link%20Clicked&ajs_uid=',SubscriberKey)                        /* Set the Collection JSON Array to a new variable to use to show badges */  IF NOT EMPTY(@hotelDetail_collection) THEN  SET @hotelDetail_collectionJson = @hotelDetail_collection  ENDIF  /* Set the Concept JSON Array to a new variable to use to show badges */  IF NOT EMPTY(@hotelDetail_concept) THEN  SET @hotelDetail_conceptJson = @hotelDetail_concept  ENDIF  IF NOT EMPTY(@hotelDetail_hotelImages) THEN  VAR @hotelImages  SET @hotelImages = BuildRowsetFromJSON(@hotelDetail_hotelImages, '$[:1]', 0)  SET @rowcountimg = RowCount(@hotelImages)  IF @rowcountimg > 0 THEN  FOR @j = 1 TO RowCount(@hotelImages) DO  SET @row = Row(@hotelImages, @j)  SET @Image = Field(@row,1)  NEXT @j  ENDIF  ENDIF                        ]%% ```T

Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>