JDBC store binder - on duplicate key

Confluence User - 17 Nov, 2020

Hi,

In the JDBC store binder is there a syntax for "create if does not exist and update if exists"?

Like this https://stackoverflow.com/questions/4205181/insert-into-a-mysql-table-or-update-if-exists


I have an app that requires that every user provide their consent before using. This has to be captured once per user for this app.

Thanks


forms;user;jdbc;storebinder

3


17 Nov, 2020
confluenceUser
confluenceUser

You can try to use userview category permission and link to beanshell with something like...

if("#form.setup.agree[currentUser.id]#" == "Agree"}{
return true;
}else{
return false;
}

to show the consent form. And the rest of the menu, negate the result. 

This way, user must submit the consent form before doing anything else.

17 Nov, 2020
confluenceUser
confluenceUser

Hi Walter,

The user can remove their consent at any time and thus the consent form has to be always shown.

My problem is not on the checking side but rather on the storing side. 

Thanks

01 Dec, 2020
confluenceUser
1
confluenceUser

Finally found out how to do it. In the form simply use 'ID" as the id for a field to be used as primary key (in my case I used username of the user). This way Joget will not create a new record on submission.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print