Hi,
I am trying to add a query parameter to a URL and refresh the fetched data on checkbox selection. The way I am trying to approach this is to add an onChange interaction to the checkbox and the event would trigger a Refresh data action. But, I don’t get how to properly set up a dynamic value for the action.
Is it the right approach in general?
Is there any documentation for the Refresh data action?
How to make complex queries resulting from interactions with various elements of UI (in other words, filters)?
What is “queryInvalidation” field for? What does it do?
I see that I can set up multiple filters for the query parameters and assign dynamic values to them. However, in case of the query parameter that can have true/false value I would like the filter to be either true or removed from the query. I don’t want to assign false value,.
Also,
even though I’ve set the min role for the query to Anonymous, when I set the preview role to this role the query returns an error and I get such notification in Plasmic Studio:
Sorry for the delay here, the issue is that there was a missing space between your dynamic value and the and after it. We’re adjusting the UI to make this easier to spot.
Hi @yang , thanks for spotting the issue. But now, for some reason, when I assign the Refresh Data action to onChange event on the checkbox (with the correct query that does return results), nothing happens… The list of elements fetched remains unchanged.
Hi @maciek_ziolkowski , the query does seem to be refreshing correctly. I just don’t think that the query is being used anywhere else on the page, so you don’t see anything change. For instance, the main list is driven by a different query, the fatchCompanies query.
I think you just need to make fatchCompanies incorporate the checkbox value, you don’t need a second query.
(You also don’t need to have Refresh query onChange at all, you can remove that. As soon as the checkbox value changes, since the query is already referencing checkbox → checked, it will update automatically)