If

The IF formula is used to create conditional logic.

The If formula is used to create conditional logic. It allows you to evaluate a condition and return one value if the condition is true and another if it’s false.

Syntax

If(Condition, TrueResult, FalseResult)
  • Condition: The logical expression that will be evaluated (e.g., ThisItem.Stock = 0).

  • TrueResult: The result or action if the condition is true.

  • FalseResult: The result or action if the condition is false.

Example

There is a Product Cost table with the cost and the quantity available for sale.

Requirement:

Based on the number in the Stock column, show the status of product stock in the Availability column.

The condition is: if the quantity in stock is greater to 0, the availability status is "Available". Otherwise, it is "Out of Stock".

Formula:

If(ThisItem.Stock > 0,"Available", "Out of Stock")

Result:

If the formula and data are correct, you can see the value of column 'Availability' in where you set to view it in the app.

Last updated