Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,904
Community Members
 
Community Events
176
Community Groups

filter within an virtual function with confiforms

I´ve understood, that when i use virtual functions, those are using from the left side and give this as an "output" to the right side. Therefore I´d thought when I now add something like a

"best before date"

to my

STOCKITEMS

and I want to see only the ones that are "good" I would take the code you give me and add:

...asFilteredBy(bestbeforedate:<[today])...

so it would look like this:

id.evaluateFormula([entry.ref2STOCKITEMS.asFilteredBy(bestbeforedate:<[today]).transform(quantity).join(+)])

But after adding this filter function nothing works anymore.

(field in view stays empty)

Here the updated complete sourcecode:

<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>
<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="bf8e8b42-2707-4dde-8ef8-87a21fc16066" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">bestbeforedate</ac:parameter>
<ac:parameter ac:name="fieldLabel">Best before Date</ac:parameter>
<ac:parameter ac:name="extras">dd.MM.yyyy</ac:parameter>
<ac:parameter ac:name="type">date</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="063bf5fd-7848-4811-9ed4-a0793f62255f" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">ref2PRODUCTS</ac:parameter>
<ac:parameter ac:name="fieldLabel">Refenrence to Product Form</ac:parameter>
<ac:parameter ac:name="values">[198190117|PRODUCTS|id|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="de64c758-e230-4003-9c41-b3bf804d70e4" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="extras5">true</ac:parameter>
<ac:parameter ac:name="condition">!productcode:[empty] AND id.queryCount(PRODUCTS:@self;productcode:[entry.productcode]):0</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">productcode=[entry.productcode]</ac:parameter>
<ac:parameter ac:name="who">PRODUCTS:this</ac:parameter>
<ac:rich-text-body>
<p>Create Product if not exists</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="22c80cf6-be76-4863-bab6-1bad22b18ae1" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="extras5">true</ac:parameter>
<ac:parameter ac:name="condition">!productcode:[empty] AND ref2PRODUCTS:[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;ref2PRODUCTS=[entry._func.queryAndSet(PRODUCTS:@self;productcode:[entry.productcode];id;created DESC LIMIT 1)]</ac:parameter>
<ac:rich-text-body>
<p>create Link to PRODUCT</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="841e764d-82ad-453c-846a-0965cf0a98a0" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="extras5">true</ac:parameter>
<ac:parameter ac:name="condition">!ref2PRODUCTS:[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.ref2PRODUCTS] &amp; ref2STOCKITEMS=[entry.ref2PRODUCTS.ref2STOCKITEMS.transform(id).asList],[entry.id]</ac:parameter>
<ac:parameter ac:name="who">PRODUCTS:this</ac:parameter>
<ac:rich-text-body>
<p>create Link in PRODUCT</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</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="4876da9b-4a63-4368-bbd9-bca56e2200cf" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">STOCKITEMS</ac:parameter>
<ac:parameter ac:name="enableGridEdit">true</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</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>
<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>
<ac:structured-macro ac:macro-id="4ec960ce-8894-4c42-961a-0d53a1744c3a" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">ref2STOCKITEMS</ac:parameter>
<ac:parameter ac:name="fieldLabel">StockItems referencing this Product</ac:parameter>
<ac:parameter ac:name="values">[198190117|STOCKITEMS|id|true||]</ac:parameter>
<ac:parameter ac:name="type">smartmultiselect</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>
<ac:structured-macro ac:macro-id="661ea590-6870-4a0b-bc3d-684121a6606f" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">PRODUCTS</ac:parameter>
<ac:parameter ac:name="enableGridEdit">true</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="a2924811-0747-4c5e-88b6-7268defddbf8" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">PRODUCTS</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="edc05a9a-0e5f-4054-9f2f-94e093b3f3e0" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productcode</ac:parameter>
</ac:structured-macro> <ac:structured-macro ac:macro-id="4ed5470b-4b54-49cb-8def-f9bd04f6b19b" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">productname</ac:parameter>
</ac:structured-macro>  <ac:structured-macro ac:macro-id="9de30635-7420-4981-8ebb-cf63599d5af8" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">id.evaluateFormula([entry.ref2STOCKITEMS.asFilteredBy(bestbeforedate:&lt;[today]).transform(quantity).join(+)])</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="e10a343c-3e45-4cae-880f-130f3c4150a5" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">STOCKITEMS</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="3cb573d1-2753-4321-8521-09f00d248894" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">ref2PRODUCTS.ref2STOCKITEMS.transform(id).asList</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

 

Thanks so much. Greetings Florian

1 answer

1 accepted

0 votes
Answer accepted

Hi

At the moment the "asFilteredBy(FILTER)" function doe snot support ConfiForms filters, but only is able to do the string matching (partial or equals)

I will make a feature request to support true filtering expressions

Alex

Thanks a lot. So I really found a limitation - for me almost impossible to belief :)

Is there any workarround you could give me as a hint?

Thanks a lot and greetings Florian

We will improve this feature in the upcoming 3.0.0 version of ConfiForms (cloud version already has it)

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events