With AMPscript I want to extract the
Start_date__c from the row with the
Clean_Order_Stage_Reached__c = True. How can i achieve that? I tried a lot with LookupRows but every time it shows all three rows. Find my code below.
This is the DE with 3 rows:
Candidate__c Clean_Order_Stage_Reached__c Start_date__c 003w000001P3Zc5AAF False 25-04-2017 003w000001P3Zc5AAF True 01-02-2017 003w000001P3Zc5AAF False 12-12-2016
This is the code i used
%%[ VAR @contact_DE, @contactID, @rowset_Startdate, @rowscount_Startdate, @row, @DEColumn1 SET @contact_DE = "Placement__c_Salesforce" SET @contactID = [_subscriberkey] SET @rowset_Startdate = LookupRows(@contact_DE,"Candidate__c",@contactID,"Clean_Order_Stage_Reached__c","True") SET @rowscount_Startdate = RowCount(@rowset_Startdate) IF @rowscount_Startdate > 0 THEN FOR @i = 1 TO @rowscount_Startdate DO SET @row = Row(@rowset_Startdate, @i) SET @DEColumn1 = Field(@row, "Start_Date__c") ]%% DEColumn1 is %%=v(@DEColumn1)=%% %%[ next @i ]%% %%[ else ]%% %%[ endif ]%%