Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Maniumek July 26, 2023

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_ 


1 answer

0 votes
Alex Medved _ConfiForms_
Community Champion
July 26, 2023

Hi

There is no such function as "asFilterBy", but there is one that is named "asFilteredBy"

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

Alex

Maniumek July 27, 2023

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?

Alex Medved _ConfiForms_
Community Champion
July 27, 2023

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?

Maniumek July 27, 2023

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)


Alex Medved _ConfiForms_
Community Champion
July 27, 2023

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?

Maniumek July 27, 2023

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.

Alex Medved _ConfiForms_
Community Champion
July 27, 2023

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

Maniumek July 31, 2023

@Alex Medved _ConfiForms_ 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.

Alex Medved _ConfiForms_
Community Champion
August 10, 2023

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events