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

Only showing those that Return true from a FOR AmpScript

$
0
0

I am searching a data extension based on an ID and returning vairables and a link from those.

I was able to get it to pull all the required data and show correctly. However when I try to add a condition for only those that equal true to show it errors out and have tried playing around with the conditions and cant seem to get it working.

Here is the code that works and brings in all the links:

%%[ var @rows, @row, @rowCount, @MasterID, @counterset @MasterId = MasterIDset @rows = LookupRows("Application__c_Salesforce","ID__c", @MasterID) set @rowCount = rowcount(@rows) if @rowCount > 0 then for @counter = 1 to @rowCount do set @row = row(@rows, @counter)set @ReadyFor = field(@row,"Ready_for_Check__c") set @ApplicationID = field(@row,"Application_Link__c") ]%%<center>&#8226; App %%=v(@counter)=%%: %%=v(@ApplicationID)=%%<br></center>%%[ next ]%% %%[ else ]%% No items to display  %%[ endif ]%%

However when I try and get only those that are True to show is when the errors start

%%[ var @rows, @row, @rowCount, @MasterID, @counterset @MasterId = MasterIDset @rows = LookupRows("Application__c_Salesforce","ID__c", @MasterID) set @rowCount = rowcount(@rows) if @rowCount > 0 then for @counter = 1 to @rowCount do set @row = row(@rows, @counter)set @ReadyFor = field(@row,"Ready_for_Check__c") set @ApplicationID = field(@row,"Application_Link__c") ]%% if @ReadyFor is True then&#8226; App %%=v(@counter)=%%: %%=v(@ApplicationID)=%%<br> %%[ else ]%%  %%[ endif ]%%%%[ next ]%% %%[ else ]%% No items to display  %%[ endif ]%%

Viewing all articles
Browse latest Browse all 359

Trending Articles



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