Confiforms: How to use .remove, .asFilterBy with smart multi-select fields?
Asked by Maniumek:

I really want to remove some data from smart multi-select fields, and i do it by trying to filter out/remove elements from that fields but it deletes all data or does nothing.  

I would really appreciate a demo explaining how to make this idea work out, docs are not precise enough for me.  

It somethind like that ok? people=\[entry.peopleList.asFilterBy(!id:_func.asEntryRef(entry.id)).transform(id).asList\] (QUESTION ABOUT SYNTAX)  

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

<br />


Answers:
author: Alex Medved _ConfiForms_
body: Hi

There is no such function as "asFilterBy", but there is one that is named "[asFilteredBy](https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions)"

And that accepts a ConfiForms Filter expression, as explained in the documentation

Alex

comments: author: Maniumek
body: I have a problem with that function, because I use it inside asEntryRef, but I still need to put inside filter something like that: "!id:\[iftttResult_relatedID\] as a filter, but when I do it and I look into the created page where given formula resolves all code dissapears

what do i do not properly?


author: Alex Medved _ConfiForms_
body: I dont understand this. How this is related to a "created page"? Do you create a page with ConfiForms and want to use a asFilteredBy expression somewhere inside the macros that you have on the page you create?


author: Maniumek
body: I have create page integration rule, and inside it I want to create ifttt integration rule "Update Confiforms Entry by filter" that uses ifttt result the way i presented it in previous message. (that ifttt result is also generated by ifttt rule that is inside the same create page integration rule)  

<br />


author: Alex Medved _ConfiForms_
body: Why do you want to embed the form inside the created page? Why not to define the form elsewhere and just use it on the page that you create?


author: Maniumek
body: I am restricted to Confiforms tool when it comes to creating relational database in confluence. And I'm trying to make this structure:

Subject - list of subjects (subjectName, listOfChildren (smart multiselect), details - link to page)

For each created subject new details page shall be created and inside it I should see a form that is strongly related to listOfChildren field in subject row (adding/removing a children to that form updates listOfChildren). It's crucial for me that every time i enter new entry/ remove entry to that form listOfChildren shall synchonize. The reason is that I think it would be easier to react (with ifttt integration rules) to form changes than to smart-multiselect changes.   

I tried to just modify listOfChildren directly, but I really struggled to track changes listOfChanges in every Subject row and react to that changes, because it's smart-multiselect field and I would have to somehome deduce what was changed.  

So that form has to be embedded as it all should be dynamic.


author: Alex Medved _ConfiForms_
body: Still not sure why do you need all this complexity with dynamically created embedded forms, but it is OK

What I can say is that ConfiForms is not a relational database and should not be considered as such

It is more a graph database, than a relational one.

But what we can improve, I believe, is the "remove" function itself.. be it more smart when applied on "smart fields"

Alex


author: Maniumek
body: [@Alex Medved _ConfiForms_](/t5/user/viewprofilepage/user-id/781630) what is the return type of .remove function?   
Is it removed item, or previous list with filtered out values included in remove function arguments?

If it's the first one, how can I set new smart multiselect value without values that I would remove via .remove function? Obviously I have to assign a value to new value, and it shall be 'previous list with filtered out values included in remove function arguments' on the right side of assigment.


author: Alex Medved _ConfiForms_
body: remove function has no return type, but it reduces the options in the multi-value field if there is a match against the parameter given in the remove function


Tags: confiforms

confluence-server

server