Using a Fallback Source When a Product Field Is Empty
Product data is not always stored consistently across an entire WooCommerce catalog.
For example, some products may have a Short Description, while others only have a full Description. Some products may have a Sale Price, while others only have a Regular Price.
Deviking Product Feeds Pro can automatically use a second source whenever the primary source is empty.
This is handled directly in the feed Mapping with Fallback Source. A Dynamic Attribute is not required for a simple “use A, otherwise use B” rule.
How Fallback Source Works
Each Mapping row can contain:
Source:
Primary value
Fallback Source:
Backup valueDuring feed generation, Deviking Product Feeds first resolves the primary Source.
If the primary Source contains a value, that value is used.
If the primary Source is empty, the plugin resolves the Fallback Source instead.
The basic logic is:
Source has a value
→ Use Source
Source is empty
→ Use Fallback SourceExample: Short Description with Description as Fallback
Suppose you want the feed’s description field to use the WooCommerce Short Description whenever it exists.
For products without a Short Description, you want to use the full Description instead.
Open:
Deviking Feeds → Feeds
Edit the required feed and go to Mapping.
Configure:
Output Field:
description
Source:
Short Description
Fallback Source:
DescriptionThe result is:
Product A
Short Description:
Lightweight running shoe.
Description:
A complete description of the running shoe...
Feed result:
Lightweight running shoe.But if another product has:
Product B
Short Description:
(empty)
Description:
Premium leather walking shoe with rubber sole.
Feed result:
Premium leather walking shoe with rubber sole.The fallback is used automatically.
XML Example
Configuration:
Output Field:
description
Source:
Short Description
Fallback Source:
DescriptionA product with a Short Description could generate:
<description>Lightweight running shoe.</description>while a product without one could generate:
<description>Premium leather walking shoe with rubber sole.</description>No separate rule needs to be created for each product.
CSV Example
The same configuration works with CSV feeds:
sku,title,description
SHOE-001,"Running Shoe","Lightweight running shoe."
SHOE-002,"Walking Shoe","Premium leather walking shoe with rubber sole."The source used for each row is determined automatically during generation.
Example: Sale Price with Regular Price as Fallback
Fallback Source is especially useful for prices.
Suppose you want to export the Sale Price whenever a product is on sale, but use the Regular Price when no Sale Price exists.
Configure:
Output Field:
price
Source:
Sale Price
Fallback Source:
Regular PriceFor a product with:
Regular Price:
100.00
Sale Price:
79.00the feed value becomes:
79.00For a product with:
Regular Price:
100.00
Sale Price:
(empty)the feed value becomes:
100.00Apply a Transform After the Fallback Is Resolved
The selected value can still use the normal Mapping Transform.
For example:
Output Field:
price
Source:
Sale Price
Fallback Source:
Regular Price
Transform:
Number Formatwith:
Decimals:
2
Decimal separator:
Dot
Thousands separator:
NoneIf Sale Price is:
79the result can become:
79.00If Sale Price is empty and Regular Price is:
100the result can become:
100.00The same Transform is applied regardless of whether the final value came from the Source or Fallback Source.
Processing Order
Mapping fields are processed in the following order:
Source
↓
Fallback Source, only if Source is empty
↓
Transform
↓
Prefix / Suffix
↓
Feed outputThis is important when formatting or modifying the resolved value.
For example:
Source:
Sale Price
Fallback Source:
Regular Price
Transform:
Number Format
Suffix:
{{source:currency}}could produce:
79.00 EURor, when Sale Price is empty:
100.00 EURUse Fallback with Product Attributes
Fallback Source is not limited to descriptions or prices.
You can use any appropriate available source.
For example, a store may contain brand information in different places.
You could configure:
Output Field:
brand
Source:
Product Brand
Fallback Source:
BrandProducts that contain the primary brand value use it directly.
Products where that source is empty use the fallback Brand source.
Use Fallback with Custom Fields
Detected product and variation meta fields can also be used as sources.
For example:
Output Field:
gtin
Source:
meta:_gtin
Fallback Source:
meta:_global_unique_idThe exact meta keys depend on the WooCommerce site and the plugins storing the product data.
When possible, select the required field directly from the Source selector.
Use Fallback with Product Attributes and Taxonomies
Available sources can also include WooCommerce attributes and custom taxonomies.
For example:
Source:
tax:product_brand
Fallback Source:
attr:pa_brandThis can be useful when part of the catalog uses a brand taxonomy while older products use a WooCommerce Brand attribute.
What Happens If Both Sources Are Empty?
If both the primary Source and Fallback Source resolve to an empty value, the final mapped value remains empty.
For example:
Source:
Short Description
Fallback Source:
Descriptionand both fields are empty:
Short Description:
(empty)
Description:
(empty)There is no value available to export.
If you need a fixed value when both sources are empty, use a Dynamic Attribute with an appropriate ELSE / Default Result.
When to Use Fallback Source
Use Fallback Source whenever the logic is simply:
Use A if available
otherwise use BTypical examples include:
Short Description
→ DescriptionSale Price
→ Regular PricePrimary Brand
→ Brand AttributePrimary GTIN field
→ Secondary GTIN fieldCustom field A
→ Custom field BThis is the simplest solution and keeps the Mapping configuration easy to understand.
When to Use a Dynamic Attribute Instead
Use a Dynamic Attribute when the decision depends on actual conditions rather than whether a field is empty.
For example:
IF Stock Status = instock
→ return one source
ELSE
→ return another sourceor:
IF Child Category = Shoes
→ return one value
ELSE
→ return another valueFor a simple empty-field fallback, creating a Dynamic Attribute is unnecessary.
Fallback Source vs Value Map
These features solve different problems.
Fallback Source chooses another field when the first field is empty:
Sale Price empty
→ Regular PriceValue Map changes an existing value:
instock
→ availableThey can also be used together because the Fallback Source is resolved before the Transform is applied.
For example:
Source:
Primary Availability Field
Fallback Source:
Stock Status
Transform:
Value MapThe resolved value can then be converted by the Value Map.
Fallback Source vs Prefix / Suffix
Prefix and Suffix do not provide fallback behavior.
For example:
Source:
Current Price
Suffix:
{{source:currency}}combines values:
19.90 EURwhile:
Source:
Sale Price
Fallback Source:
Regular Priceselects between two possible sources.
These features can be combined in the same Mapping row when required.
Example: Complete Price Configuration
A practical feed price mapping could be:
Output Field:
price
Source:
Sale Price
Fallback Source:
Regular Price
Transform:
Number Format
Decimals:
2
Decimal separator:
Dot
Thousands separator:
None
Suffix:
{{source:currency}}For a discounted product:
Regular Price:
100
Sale Price:
79
Currency:
EURresult:
79.00 EURFor a product without a Sale Price:
Regular Price:
100
Sale Price:
(empty)
Currency:
EURresult:
100.00 EURPreview the Fallback Behavior
After configuring the Mapping:
- Save the feed.
- Run Preview.
- Check a product where the primary Source contains a value.
- Check a product where the primary Source is empty.
- Confirm that the expected Fallback Source is used.
- Check any configured Transform, Prefix or Suffix.
- Run Validate Feed.
- Use Save & Generate when the output is correct.
Recommended Configuration
For the common description example:
Output Field:
description
Source:
Short Description
Fallback Source:
DescriptionFor prices:
Output Field:
price
Source:
Sale Price
Fallback Source:
Regular PriceFor brand information:
Output Field:
brand
Source:
Product Brand
Fallback Source:
BrandWhenever the requirement is simply “use this field, but if it is empty use another field”, the built-in Fallback Source is the appropriate solution.