Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confiforms remove action

Alexandra May 17, 2020

I have a  few forms on different pages. I am deleting data older than two weeks with an external script and the confiforms API by calling

https://wiki....../ajax/confiforms/remove.action?pageId=$page&f=$form&q=time.startdate:%3C($date)

This is working perfectly for most forms. However, for two forms, all the data gets deleted. The field names are the same for all. The filter action shows the correct data (meaning everything old enough...) Anyone any idea whats happening?

2 answers

0 votes
Alex Medved _ConfiForms_
Community Champion
May 18, 2020

Delete entries by filter REST API method (https://wiki.vertuna.com/display/CONFIFORMS/REST+API#RESTAPI-Deleteentries) uses the same logic as the search entries REST API. 

Share your form(s) configurations and I can take a look. Most often users setup some logic using ConfiForms IFTTT macros that also modify the data on various events happening in the forms

Looking at "time.startdate" makes me think you have multiple forms involved

Also, share the parameters you invoke the REST API method

 

If you feel more comfortable you can open a ticket with our support at https://wiki.vertuna.com/display/VERTUNA/Support+Request+Form

Alexandra May 25, 2020

Here is one of the forms:

<ac:structured-macro ac:macro-id="f3d4b953-737d-4e9d-908f-00c0440e7332" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formSuperUsers">ge79wol</ac:parameter>
<ac:parameter ac:name="formName">electronics</ac:parameter>
<ac:parameter ac:name="registrationFormTitle">Add new event</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="2a71b2ea-e727-4632-9153-0ef8bb4730d1" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">time</ac:parameter>
<ac:parameter ac:name="fieldLabel">Time</ac:parameter>
<ac:parameter ac:name="values">30</ac:parameter>
<ac:parameter ac:name="extras">dd.MM.yy HH:mm</ac:parameter>
<ac:parameter ac:name="type">datetimeinterval</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="7f903c7f-278c-46e9-aa3d-3a0773e251ae" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">name</ac:parameter>
<ac:parameter ac:name="fieldLabel">Name</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="72adf069-1ce7-4b92-a644-1aea78e23728" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">choice</ac:parameter>
<ac:parameter ac:name="fieldLabel">Token</ac:parameter>
<ac:parameter ac:name="values">false[1=Person 1|2=Person 2|]</ac:parameter>
<ac:parameter ac:name="fieldDescription">Please choose one token that ensures no overlap</ac:parameter>
<ac:parameter ac:name="type">select</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="6f958e92-c767-4e02-9107-81c8c055421f" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">choice:[entry.choice] AND time.startDate:&lt;[entry.time.endDate] AND time.endDate:&gt;[entry.time.startDate] AND !id:[entry.id]</ac:parameter>
<ac:parameter ac:name="fieldName">There is already a person at this time</ac:parameter>
<ac:parameter ac:name="action">Validation rule dataset</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="9c8015bf-796f-4e27-8770-ae1e717c6ed2" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">electronics</ac:parameter>
<ac:parameter ac:name="presetValues">name=[user.fullName]</ac:parameter>
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>

I call

https://wiki....../ajax/confiforms/remove.action?pageId=$page&f=$form&q=time.startdate:%3C($date)

with page as the pageid (487817252). form=electronics and date is something like (1590408648000-604800000)

Alexandra May 25, 2020

Here is the code of one of the forms

<ac:structured-macro ac:macro-id="f3d4b953-737d-4e9d-908f-00c0440e7332" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formSuperUsers">ge79wol</ac:parameter>
<ac:parameter ac:name="formName">electronics</ac:parameter>
<ac:parameter ac:name="registrationFormTitle">Add new event</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="2a71b2ea-e727-4632-9153-0ef8bb4730d1" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">time</ac:parameter>
<ac:parameter ac:name="fieldLabel">Time</ac:parameter>
<ac:parameter ac:name="values">30</ac:parameter>
<ac:parameter ac:name="extras">dd.MM.yy HH:mm</ac:parameter>
<ac:parameter ac:name="type">datetimeinterval</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="7f903c7f-278c-46e9-aa3d-3a0773e251ae" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">name</ac:parameter>
<ac:parameter ac:name="fieldLabel">Name</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="72adf069-1ce7-4b92-a644-1aea78e23728" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">choice</ac:parameter>
<ac:parameter ac:name="fieldLabel">Token</ac:parameter>
<ac:parameter ac:name="values">false[1=Person 1|2=Person 2|]</ac:parameter>
<ac:parameter ac:name="fieldDescription">Please choose one token that ensures no overlap</ac:parameter>
<ac:parameter ac:name="type">select</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="6f958e92-c767-4e02-9107-81c8c055421f" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">choice:[entry.choice] AND time.startDate:&lt;[entry.time.endDate] AND time.endDate:&gt;[entry.time.startDate] AND !id:[entry.id]</ac:parameter>
<ac:parameter ac:name="fieldName">There is already a person at this time</ac:parameter>
<ac:parameter ac:name="action">Validation rule dataset</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="9c8015bf-796f-4e27-8770-ae1e717c6ed2" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">electronics</ac:parameter>
<ac:parameter ac:name="presetValues">name=[user.fullName]</ac:parameter>
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
0 votes
Gonchik Tsymzhitov
Community Champion
May 17, 2020

Hi!

Please, add com.vertuna.confluence.plugins.confiform package into log with level DEBUG.

 

Hope it will show for you the some unexpected behaviour.

Alexandra May 25, 2020

I have requested access to the log, but haven't heard back yet

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events