Hi,
I'm having trouble finding the syntax for filtering based on a smart multirow field.
Example:
I have two forms, F1 and F2, while F2 is used as smart multi-row field in F1 (lets name the field "smr").
I want to filter entries from F1 based on if their smr field contains a specific entry from F2.
What syntax should I use?
context: I want to use the queryAndRender function on merger table to show for each F2 entry a list of F1 entries on which their smr field contains a specific F2 entry, but I can't figure out the syntax for filtering based on a smart multi-row field.
id.queryAndRender(F1:<pageID>;<filter????>;id;table)
Thanks.
Thanks for the response Alex.
Just to clarify,
F1 fields: name_f1(text), smr(smart multi row)
F2 fields: name_f2(text)
MergeTable: name_f2(field), queryAndRender(field), F2(table view)
in this case, wouldn't [entry] refer to the entries from F2?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is a "MergeTable"? What do you merge?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use it more for using expressions in fields and less for merging two tables (As they are already merged by the Smart Multi Row).
Am I using it wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont quite understand... What do you merge?
Or at least what form is the source for the TableViewMerger - F1 or F2?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry about the confusion.
Tried creating a simple example of what I am trying to do:
the table merger currently looks like this:
While what I want is for each unique F2 name row to apear once in the merger table, and the second column to contain a list of each of F1's entries where the SMR field contains that name.
for example (edited image):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where an expression for queryAndRender is something like this
id.queryAndRender(F1:@self;smr:[entry.id];name1;table)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doesn't seem to work for me. Renders the table with only the name2 column.
also the help text in edit form make is seem like using expression in field name should only work on Table Merger:
Name of the field defined in the form (can be with 'virtual functions') or expression (supported expressions) when used in TableView Merger macro
Did I get that wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works for me just fine and renders exactly what you have in the "edited image"
And the ConfiForms Field macro's field name parameter accepts an expression or a field name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright, when moved it back to the table merger, it worked.
Also I seem to have confused the flattenByField and the distinct configurations.
Thanks alot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just found the following answer on another thread, but it seems it doesn't work for me:
smr.asFilteredBy(name:[entry.name]).asCount:>0
I'm trying to use the (custom) name field specifically and not id because I have several entries with the same name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.