Hey Alban,
One trick you could use is a hidden column that has a default value in your View via its column settings. The View then can have two variants, let's say VariantA and VariantB. The default value for this column can then be altered in the respective variants. That value then can be used in the Default logic of the View.
Example, column named ref_location, in VariantA default value locationA, in VariantB default value locationB
Your code could then do the following:
if @cursor_from_col_id = 'columnA'
and @ref_location = 'locationA'
begin
print 'A'
end
if @cursor_from_col_id = 'columnB'
and @ref_location = 'locationB'
begin
print 'B'
end
So yes, the variant_id is not a given in the Default logic, but you can mimic that using this trick. An idea for that was raised here: variant_id for layouts, contexts, defaults | Thinkwise Community (thinkwisesoftware.com)