Undefined properties in lookup functions

Hi Community,

I need help with the lookup function in Weweb. When a value isn’t found, it should return ‘1’ instead of erroring out due to undefined properties. Any suggestions for handling this directly in the formula? Thanks!

try ?.lable_de

Hey, I have another problem of the same nature. When I want to refer to one of the two results in a workflow and only one of them returns a value, one of them is undefined. However, I still want to select one of them because the other has properties in the object. WeWeb is completely resistant to this and I can’t find a solution to solve it with the question mark either. Is there possibly a NoCode solution for this? If not, I can also solve it with JavaScript. However, it would be better in NoCode.


You could just stack/nest ifempty calls to solve this, but its an area where a bit of JS syntax could be a lot easier to read than trying to jam it into the weweb formula construct. You don’t have to leave formula mode to bring these operators to bear. I might build a bit of a ternary, like:

([new upload s3] || [new upload s3.result]) ? [new upload s3.result] : [new nonproject upload s3.result]

The || gets turned into a gray “or” in the formula builder, further showing how it is generating JS code under the covers.

1 Like

you can try by moving to js, you can still insert formulas and variables and you can add optional chaining (?.) to the result access

2 Likes