Hi @Cory_Fauna thanks for your help!
I will give you a context of what I want to achieve… I have an FQL function that what it does is bring the results with different dynamic parameters:
const matches = [];
if(param1) matches.push(Match(Index("ejemplares_ref_by_param1"), param1));
if(param2) matches.push(Match(Index("ejemplares_ref_by_param2"), param2));
Let(
{
match: If(
And(dateRangeOne, dateRangeTwo),
Intersection(
Join(
Range(
Match(Index("ejemplares_ref_by_dateRangeOne")),
[dateRangeOneInit],
[dateRangeOneEnd]
),
Lambda(["value","ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
),
Join(
Range(
Match(Index("ejemplares_ref_by_dateRangeTwo")),
[dateRangeTwoInit],
[dateRangeTwoEnd]
),
Lambda(["value","ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
),
Join(
Intersection(matches),
Lambda(["data", "ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
),
),
If(
dateRangeOne,
Intersection(
Join(
Range(
Match(Index("ejemplares_ref_by_dateRangeOne")),
[dateRangeOneInitInit],
[dateRangeOneInitEnd]
),
Lambda(["value","ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
),
Join(
Intersection(matches),
Lambda(["data", "ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
)
),
If(
dateRangeTwo,
Intersection(
Join(
Range(
Match(Index("ejemplares_ref_by_dateRangeTwo")),
[dateRangeTwoInit],
[dateRangeTwoEnd]
),
Lambda(["value","ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
),
Join(
Intersection(matches),
Lambda(["data", "ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
),
),
Join(
Intersection(matches),
Lambda(["data", "ref"], Match(Index("ejemplar_values_by_ref"), Var("ref")))
)
)
)
),
size: limit ? parseInt(limit, 10) : 20,
after,
before,
page: If(
Equals(Var("before"), null),
If(
Equals(Var("after"), null),
Paginate(Var("match"), { size: Var("size") }),
Paginate(Var("match"), {
after: Var("after"),
size: Var("size")
})
),
Paginate( Var("match"), {
before: Var("before"),
size: Var("size")
}
)
),
},
Var("page")
)
As you can see it’s a big query based on multiple user options, I want a preview results (manage with pagination) and also I need to print the complete results (results may vary from 100 to 10000) to a PDF document.
I hope this can help you better understand what I’m trying to achieve.
Thanks guys!