Setting up condition on Server Action / update action

Hi everybody,
it is first time I m dealing with conditions in Server Connect and I do not understand exactly how to set up the condition.

I have two tables: registry of all sent email and the Opened email table.

I set up a query1 that is a simple query listing Sent_email table
I added a repeat with a query2 listing the Opened_email

And it works.

From this point I added a condition, idea is to do the following:

if the Query 2 has value, then I have to update Sent_table (in field: opened, with value 1)

I tried to do but nothing happens.

Can you help me please?

Thank you very much

Roberto

The structure looks OK.

If the repeat step works then the problem will be the update step.

1 Like

Yes… what I m afraid is that MySQL accept these kind of operation only with Forms and POST.
But last time I had to click on 890 buttons… so I was hoping to find a more automated system :slight_smile:

In the condition step instead of the {{query2}} type {{query2.length > 0}}
This will make everything inside the condition to execute only if the query returns something.

Thank you

1 Like

Forgetting what you have done to date can you concentrate on explaining in more detail what data you are using as a condition and what you are trying to do. I suspect you may not need the conditions, and it can all be done with a single sql insert.

1 Like

Thank you very much @t11. Not a case you reached me to use repeat :slight_smile:

Just a question: where do you find these attributes like length? I d like to study them.

@Hyperbytes I think you are right… Now let me focus better the problem and will share with you!

Well actually don’t know… I had the same issue and after struggling for hours decided to talk with the support @Teodor and he told me. :slight_smile:

1 Like

Hello,
Actually for checking if a query has records, you only need the {{query}} in the condition.
If it returns records -> then step will run.
If it returns no records ->else step will run.

{{query.length}} check is not really required here.

Most probably a wrong values is used somewhere in the update step.

1 Like