Confiforms: IFTTT onCreated, how to Update fields, specifically ownedBy field
Asked by fbunting:

In Confiforms, I'm using IFTTTs with 'Create/Update ConfiForms Entry' action to auto-populate some fields before saving. One field I am auto-populating is the built-in *ownedBy* field.   

This works fine with the *onModified* event. (Set parameters using '**entryId=\[entry.id\]\&ownedBy=\[entry.OwnersList\]** ')  

But this fails with the *onCreated* event. (I.e. I am trying to set the *ownedBy* field as I create a new record.)  

I think this is because one has to preface the list of fields to set with '**entryId=\[entry.id\]** ' ... but in the *onCreated* event, the record does not have an assigned Id yet. So it would seem that one cannot set \*any\* fields with the *onCreate* event.

Is there a way to do this?


Answers:
author: Alex Medved _ConfiForms_
body: ConfiForms record ALWAYS has id when processing IFTTTs, so I am really unsure what do you experience here

Please share an example that does not work for you... Also, what is "**OwnersList**" field type?

Alex

comments: author: fbunting
body: Hmm ... never mind ... it's working now!  

When I went to create an example, I couldn't make one that reproduced the problem.  

But for the record, here's my Confiforms code. This was to give record-owners a way to add/delete other record owners ... by giving them an editable *multiuser* field, **OwnersList** , that I then copy to **ownedBy** using the IFTTT. (As **ownedBy** otherwise seem to be only editable by form admins after creation.)


author: fbunting
body: \<ac:structured-macro ac:macro-id="66eda896-2ae2-4e74-87b2-9decef2d5b9f" ac:name="confiform" ac:schema-version="1"\>  
\<ac:parameter ac:name="formName"\>FORM1\</ac:parameter\>  
\<ac:rich-text-body\>  
\<p\>  
\<ac:structured-macro ac:macro-id="94ea73fa-e9be-4f1f-8a69-92b407b511d1" ac:name="confiform-field-definition" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>RecordName\</ac:parameter\>  
\<ac:parameter ac:name="fieldLabel"\>Record Name\</ac:parameter\>  
\<ac:parameter ac:name="type"\>text\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>  
\<p\>  
\<ac:structured-macro ac:macro-id="d55c0f3c-15b8-4073-b7ca-51f8306c7e67" ac:name="confiform-field-definition" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>OwnersList\</ac:parameter\>  
\<ac:parameter ac:name="fieldLabel"\>Owners List\</ac:parameter\>  
\<ac:parameter ac:name="fieldDescription"\>Please list all people who you want to edit this record.\</ac:parameter\>  
\<ac:parameter ac:name="type"\>multiuser\</ac:parameter\>  
\<ac:parameter ac:name="separator"\>;\</ac:parameter\>  
\<ac:parameter ac:name="required"\>true\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>  
\<p\>  
\<br/\>  
\</p\>  
\<ac:structured-macro ac:macro-id="290e765f-fd60-4c2b-8549-61d78b6dd82a" ac:name="confiform-ifttt" ac:schema-version="1"\>  
\<ac:parameter ac:name="action"\>Create ConfiForms Entry\</ac:parameter\>  
\<ac:parameter ac:name="event"\>onCreated\</ac:parameter\>  
\<ac:parameter ac:name="title"\>entryId=\[entry.id\]\&amp;ownedBy=\[entry.OwnersList\]\</ac:parameter\>  
\<ac:rich-text-body\>  
\<p\>On Creation event, this copies the OwnersList field into the hidden ownedBy field. \</p\>  
\</ac:rich-text-body\>  
\</ac:structured-macro\>  
\<p class="auto-cursor-target"\>  
\<br/\>  
\</p\>  
\<ac:structured-macro ac:macro-id="bd070467-53c7-4506-a705-ae5f4b62a7a9" ac:name="confiform-ifttt" ac:schema-version="1"\>  
\<ac:parameter ac:name="action"\>Create ConfiForms Entry\</ac:parameter\>  
\<ac:parameter ac:name="event"\>onModified\</ac:parameter\>  
\<ac:parameter ac:name="title"\>entryId=\[entry.id\]\&amp;ownedBy=\[entry.OwnersList\]\</ac:parameter\>  
\<ac:rich-text-body\>  
\<p\>On Modified event, this copies the OwnersList field into the hidden ownedBy field. \</p\>  
\</ac:rich-text-body\>  
\</ac:structured-macro\>  
\<p\>  
\<br/\>  
\</p\>  
\<ac:structured-macro ac:macro-id="a5ec70a0-4cf0-4fe2-89c7-52315a4ba32a" ac:name="confiform-entry-register" ac:schema-version="1"\>  
\<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\>  
\<p class="auto-cursor-target"\>  
\<br/\>  
\</p\>  
\</ac:rich-text-body\>  
\</ac:structured-macro\>  
\<p\>  
\<br/\>  
\</p\>  
\<ac:structured-macro ac:macro-id="edaf1246-b088-4280-9676-13e79f341abc" ac:name="confiform-table" ac:schema-version="1"\>  
\<ac:parameter ac:name="formName"\>FORM1\</ac:parameter\>  
\<ac:rich-text-body\>  
\<p\>  
\<ac:structured-macro ac:macro-id="baa7965e-971f-4c93-b756-7a5d8743ac59" ac:name="confiform-field" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>RecordName\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>  
\<p\>  
\<ac:structured-macro ac:macro-id="0891656d-4623-43fb-8f5d-d8c1dcce7134" ac:name="confiform-field" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>OwnersList\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>  
\<p\>  
\<ac:structured-macro ac:macro-id="96cb7266-ce30-4eca-9f7a-afb9123a8381" ac:name="confiform-field" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>ownedBy\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>  
\</ac:rich-text-body\>  
\</ac:structured-macro\>


author: Alex Medved _ConfiForms_
body: I would tune this a bit...

```
<ac:structured-macro ac:macro-id="66eda896-2ae2-4e74-87b2-9decef2d5b9f" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">FORM1</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="94ea73fa-e9be-4f1f-8a69-92b407b511d1" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">RecordName</ac:parameter>
<ac:parameter ac:name="fieldLabel">Record Name</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="d55c0f3c-15b8-4073-b7ca-51f8306c7e67" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">OwnersList</ac:parameter>
<ac:parameter ac:name="fieldLabel">Owners List</ac:parameter>
<ac:parameter ac:name="fieldDescription">Please list all people who you want to edit this record.</ac:parameter>
<ac:parameter ac:name="type">multiuser</ac:parameter>
<ac:parameter ac:name="separator">;</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="b4e9cd56-9abc-4561-b305-0597759c8212" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;ownedBy=[entry.OwnersList.asList]</ac:parameter>
<ac:rich-text-body>
<p>On Creation event, this copies the OwnersList field into the hidden ownedBy field.</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="d4fcfa31-4d87-4a0a-9314-e76c18346118" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;ownedBy=[entry.OwnersList.asList]</ac:parameter>
<ac:rich-text-body>
<p>On Modified event, this copies the OwnersList field into the hidden ownedBy field.</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="a5ec70a0-4cf0-4fe2-89c7-52315a4ba32a" ac:name="confiform-entry-register" ac:schema-version="1">
<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>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="edaf1246-b088-4280-9676-13e79f341abc" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">FORM1</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="baa7965e-971f-4c93-b756-7a5d8743ac59" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">RecordName</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="0891656d-4623-43fb-8f5d-d8c1dcce7134" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">OwnersList</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="96cb7266-ce30-4eca-9f7a-afb9123a8381" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">ownedBy</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
```

Making sure the ownedBy field gets always a correctly formatted list of usernames

```
ownedBy=[entry.OwnersList.asList]
```

And will make sure the IFTTTs that update the record dont fire the "Modify" events and dont trigger the "onModified" IFTTT handlers

![Screenshot 2021-05-20 at 10.01.17.png](https://community.atlassian.com/t5/image/serverpage/image-id/144165iBDCFC247CCFA2920/image-dimensions/460x156?v=v2 "Screenshot 2021-05-20 at 10.01.17.png")

Alex


author: fbunting
body: Thank you, Alex. Two good tips!


Tags: confiforms

confluence-server

server