How to insert new confiforms record into another form with Javascript
Asked by Piotr Gugnowski:

How to use javascript inside ifttt onCreated rule to add new entry inside another form.

In fact I would like to know every command that can help me to interact with confiforms inside Javascript inside ifttt rule. (How to delete/update rows that meet certain conditions or by id.)

I would also like how to read data from a whole form, not just entry that fired onCreated ifttt rule.

[@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)


Answers:
author: Alex Medved _ConfiForms_
body: Hi

Absolutely lost on why would you need to do that, but... the JS in IFTTT is executed on browser AFTER the record gets created and the form submit returns to the page where it was submitted from

Here is how you can put a JavaScript to execute after the submit <https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-RunJavaScript>

Here is how you can interact with ConfiForms data through the APIs - <https://wiki.vertuna.com/display/CONFIFORMS/REST+API>

The things you mentioned are much easier done with IFTTTs that update or create or delete ConfiForms entries

* <https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-Create(Update)ConfiFormsEntry>
* <https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-UpdateConfiFormsEntriesbyFilter>
* <https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-DeleteConfiFormsEntry>

Alex

comments: author: Piotr Gugnowski
body: How can I use create confiforms entry to enter multiple rows in one ifttt rule? I have smart multiselect FIELD-X that contains for ex. \[A, B, C\] values and i want the integration rule to create new rows in another form : with FIELD-Y values rowA, rowB, rowC respectfully. Lenght of FIELD-X list is not fixed.


author: Alex Medved _ConfiForms_
body: You can use copy data IFTTT with "flatten entries" option enabled - <https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-CopyConfiFormsData>


author: Piotr Gugnowski
body: Thanks, I need it because i want to estabilish many to many relation between two confiforms via smart multiselect fields and additional "relation" form


author: Piotr Gugnowski
body: [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630)

Is there any way to simulate that flattening in Update Confifofms entries by filter?

I have form Y with rows (name, list of tasks):

1. Kevin, empty list

2. Jacob, \[jumping, skiing\]

3. Tyson, \[jumping\]

I have form X, and I enter such row (taskName, assignedPeople):

1. Rowing, \[Kevin, Jacob\]

Y rows that contain kevin and jacob should have Rowing assigned to their lists of tasks

How can I do it? (I know that udpate by filter would be helpful but I dont know to write "Parameters to set on the entry" properly.) I would appreciate a demo.


Tags: confiforms

confluence-server

server