Add Row to HTML statement only if webhook field is filled

Hello,
I want to add an HTML row to an email content only if a field submitted by the webhook is filled.

I tried already with the IF statement, but the error raised is: "field format not supported.

Maybe it is just the basic knowledge which is missing:

I wrote:

If( field1!=;<tr><td>field1name</><td>field1</td><tr>;)

field1 is either empty or a text, but this is not defined anywhere I guess.

So is this condition correct? or is something like ‘’ or “” required?

I recognised the funtion isempty(field1;test), but my thought is, with my expectations. this will never be empty as I would state it this way:

IfEmpty(<tr><td>field1name</><td>field1</td><tr>;)

Thanks upfront for the help.

Regards

Hi @Thomas_Holzer,

Welcome to the Make community!

Does your function return the error or is the error returned by the email module? Can you try this?
{{if(35.empty != emptystring; "<tr><td>field1name</><td>field1</td><tr>"; )}}

Please, follow these steps when asking a question, and you’ll be more likely to get a helpful answer:

:writing_hand: Give us a detailed explanation of what you’re trying to achieve

:footprints: Tell us about any steps you’ve tried so far

:camera_flash: Include screenshots of:

  • your scenario flow and setup (functions, mappings, variables, etc.)
  • module configurations and outputs
  • any error messages you are getting

:card_file_box: Share the blueprint of the scenario you are asking a question about. (this does not contain any connection or personal information)

Cheers,
Henk

Hi Henk,
thanks for your try to support.

Unfortunately it still is not working as expected, as I tried some other variations as well.

The statement you provided didn’t work and the brackets {{}} remain within the result, while the if statement is vanishing as it should.

So the If statement still results in a wrong solution.

The value delivered by the webhook for this try is:

falls-akute-medikamente-welche:

image
image

Please find attached the blueprint of the last try.

blueprint.json (19.5 KB)

BR

@Henk-Operative :pray:
your solution helped me to identify the emptystring feature.

In my try I did just copy it.
But during my search about this emptystring i recognised it needs to be colored and taken from the public statements.

image

Now it works.

Thanks for the hint and all the best.
BR

2 Likes