[英]how to fetch enitre column values in sfmc/email from data extension. Using ampscript
[英]SFMC AMPscript Understanding Controlling Expression Evaluation unclear
下面的表達對我來說沒有意義。 我很難理解為什么會導致“免費送貨”。 有人可以詳細說明一下嗎?
%%[
var @statusTier, @amount, @freeShipping
set @statusTier = "Bronze"
set @amount = 300
if @statusTier == "Bronze" or @statusTier == "Silver" and @amount > 500 then
set @freeShipping = true
endif
]%%
<p>You %%=Iif(@freeShipping == true, "qualify","do not qualify")=%% for free shipping.</p>
Output:
The join operators in the above if statement will be evaluated as a single expression and will produce the following result:
<p>You qualify for free shipping.</p>
根據我的理解,300 的設定數量不是 > 500,因此這不應該是真實的陳述,應該是 output “您不符合免費送貨的條件。” . 我在這里遺漏了什么? 請幫忙,我是 AMPscript 的新手,對 JavaScript 知之甚少。
THE AMPSCRIPT GUIDE 原帖: https://ampscript.guide/controlling-expression-evaluation/
感謝您提前輸入!
ampscript 指南帖子中的示例演示了操作順序。
當 OR 條件周圍沒有括號時,代碼將評估為true
,因為它將整個條件視為單個表達式。
添加括號時:
if (@statusTier == "Bronze" or @statusTier == "Silver") and @amount > 500
()
中的 OR 條件將首先被評估,然后 AND 條件將被評估。 這將導致false
,因為@amount 實際上小於 500。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.