Update of Ruled Fields in ConfiForms when Importing Data from Source
Asked by Florian Seibold:

Hi together,

I?m currently wondering if there is a way to automatically "update" the entries of a Form after importing data from a List.  

I do have 2 Forms, both contain a number which should link those 2 lists.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/233514iCB745BC19C31B310/image-size/large?v=v2&px=999 "image.png")

When I now (manually) Register a Item on "STOCKITEMS" and enter a Number, the Reference to Product Form is automatically filled out.  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/233515iB76CF0EA2CE5A9F9/image-size/large?v=v2&px=999 "image.png")

The Problem for me starts when I want to Import data from a source like a excel file. When I do this, I get the entries, but the references miss.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/233516i1EE98B59A2873211/image-size/large?v=v2&px=999 "image.png")

When I go and hit the edit button for a entry, the reference is automatically done and i could save it. Is there a way to automate this "Update"?

Thanks a lot in advance

Florian

CODE:

```
<ac:structured-macro ac:macro-id="1f1aee26-aacb-40f7-908e-9604ffd3b148" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">STOCKITEMS</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="476e146e-845d-4a38-8345-35913d54987b" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productcode</ac:parameter>
<ac:parameter ac:name="fieldLabel">Product Code</ac:parameter>
<ac:parameter ac:name="type">number</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="69c4e1b1-7e0e-4342-8927-f2aee7e24cf5" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">quantity</ac:parameter>
<ac:parameter ac:name="fieldLabel">Anzahl</ac:parameter>
<ac:parameter ac:name="type">number</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="98febb5a-3f39-466e-a3b1-cc9287dfe6a7" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">product</ac:parameter>
<ac:parameter ac:name="fieldLabel">Refenrence to Product Form</ac:parameter>
<ac:parameter ac:name="values">[198190117|PRODUCTS|productname|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="c58b523a-38a5-42d7-b830-bd99cc4c93d1" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="fieldName">product=[entry.id]</ac:parameter>
<ac:parameter ac:name="values">productcode:*[entry.productcode]</ac:parameter>
<ac:parameter ac:name="action">Lookup and set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">productcode</ac:parameter>
<ac:parameter ac:name="values2">PRODUCTS:this</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="3ebcb3de-a752-4615-96d7-de00aabb445c" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">STOCKITEMS</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="a2be81c6-ce23-47b3-a2f3-0ae652a84c11" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">PRODUCTS</ac:parameter>
<ac:parameter ac:name="registrationFormTitle">Produkte aus ABAS</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="1198a13c-1ec3-4bf6-a963-776125c229cb" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productcode</ac:parameter>
<ac:parameter ac:name="fieldLabel">Product Code</ac:parameter>
<ac:parameter ac:name="type">number</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="4570cf5d-18cd-4cf4-bfcd-88bda294ea33" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productname</ac:parameter>
<ac:parameter ac:name="fieldLabel">Product Name</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="c8ab3ed3-3779-4dc1-b34b-f9db82c21ad9" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">description</ac:parameter>
<ac:parameter ac:name="fieldLabel">Beschreibung</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="83c05741-9f9b-46c7-a5c9-4c9e72fedf8a" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">PRODUCTS</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
```


Answers:
author: Florian Seibold
body: Isn?t there anything "automatic" possible? I?ve read about REST API, IFTTT but I really do not know which path to take. The problem is i have to update the form by excel files and i do not want to play in excel to make it fit. That is annoying.

For me it is also fine when the "product" field is automatically filled out by whom ever... no need to be a smart field. I just need the reference to the Products...

comments: author: Alex Medved _ConfiForms_
body: What do you mean by automatic?

There are IFTTT rules, there is a REST API, but I dont quite understand what do you mean by "automatic". You are trying to update the form with the data it does not understand. With values that are not correct (for smart fields)...


author: Florian Seibold
body: Can I trigger a routine that runs over all entries and adds the reference to the "product" by a number like here product code?


author: Florian Seibold
body: Or when importing the values of "STOCKITEMS" run a routine that enters for each new entry the link to the reference product?


author: Alex Medved _ConfiForms_
body: Consider this setup

```
<ac:structured-macro ac:macro-id="1f1aee26-aacb-40f7-908e-9604ffd3b148" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">STOCKITEMS</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="476e146e-845d-4a38-8345-35913d54987b" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productcode</ac:parameter>
<ac:parameter ac:name="fieldLabel">Product Code</ac:parameter>
<ac:parameter ac:name="type">number</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="69c4e1b1-7e0e-4342-8927-f2aee7e24cf5" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">quantity</ac:parameter>
<ac:parameter ac:name="fieldLabel">Anzahl</ac:parameter>
<ac:parameter ac:name="type">number</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="98febb5a-3f39-466e-a3b1-cc9287dfe6a7" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">product</ac:parameter>
<ac:parameter ac:name="fieldLabel">Refenrence to Product Form</ac:parameter>
<ac:parameter ac:name="values">[198190117|PRODUCTS|productname|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="54dc005f-c17d-4b5c-9693-17bb07d1dfe6" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">!productcode:[empty]</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;product=[entry.id.queryAndSet(PRODUCTS:@self;productcode:[entry.productcode];id;LIMIT 1)]</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="e966768c-e639-4cf0-b4d6-1309f2518c5e" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(productcode):true AND !productcode:[empty]</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;product=[entry.id.queryAndSet(PRODUCTS:@self;productcode:[entry.productcode];id;LIMIT 1)]</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="3ebcb3de-a752-4615-96d7-de00aabb445c" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">STOCKITEMS</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="a2be81c6-ce23-47b3-a2f3-0ae652a84c11" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">PRODUCTS</ac:parameter>
<ac:parameter ac:name="registrationFormTitle">Produkte aus ABAS</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="1198a13c-1ec3-4bf6-a963-776125c229cb" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productcode</ac:parameter>
<ac:parameter ac:name="fieldLabel">Product Code</ac:parameter>
<ac:parameter ac:name="type">number</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="4570cf5d-18cd-4cf4-bfcd-88bda294ea33" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productname</ac:parameter>
<ac:parameter ac:name="fieldLabel">Product Name</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="c8ab3ed3-3779-4dc1-b34b-f9db82c21ad9" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">description</ac:parameter>
<ac:parameter ac:name="fieldLabel">Beschreibung</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="83c05741-9f9b-46c7-a5c9-4c9e72fedf8a" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">PRODUCTS</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
```


author: Florian Seibold
body: That?s it!!! I love you guy so much for your help!!!!  

I?ll never would have found out whats the right way to use the IFTTT ....


author: Alex Medved _ConfiForms_
body: Hi

Your "product" field seems to be a smart field and that means it stores the reference to other record in the form of UUID

On imports you need to provide internal values and that is a UUID for the smart field (there is an *id* field in each ConfiForms record)

Alex


Tags: confiforms

confluence-server

forms

server