I am wondering if it is possible to dynamically change filters of a FetchXML in dynamics portal using Liquid, for example.
{% fetchxml fetchActivities %} {{% if {{ RecordId }} %}} {% else %} {% endif %} {% endfetchxml %}
Above code throw an exception, Unknown tag 'endif'.
Please let me know if there is any idea to achieve above.
Hi Mohsin,
It is definitely possible to dynamically change the filters.
I think the issue is coming from your IF statement as you have the incorrect syntax for the filter.
Instead of {{% if {{ RecordId }} %}} you need to have it as {% if RecordId %} as this will check to see if the RecordId variable/parameter is set.
Try changing that up and see if it fixes the issue. I do have this in my own code for some clients so I know it's possible.
If you can mark this as Answered assuming it solves your problems that would be appreciated!
Also, if you're bored, checkout my blog here!
Thanks!
Matt Bayes