Hi,
Instead of using the entity list and enabling odata, you can use the fetchXml directly on the web page which you going to show the anonymous user.
Fetch XML can only be executed on load of the form through liquid code. So what you need to do is -On the click of the button add querystring on the url (field name and user provided value) and reload the form.
Once the form is reloaded, the liquid code will be executed and it will check if all the query string keys are present. If yes, then it executes the fetchXML.
Follow the below step:
1. Go to the content page of web page.
2. Write the below code on the Copy (HTML) field of a Web Page
{% if user and request.params.id %}
{% fetchxml getSlots %}
<fetch version="1.0" mapping = "logical" output - format="xml-platform" distinct = "false" >
<entity name="nur_executeportalaction" >
<attribute name="nur_executeportalactionid" > </attribute>
< attribute name = "nur_name" > </attribute>
< attribute name = "nur_result" > </attribute>
< order descending = "false" attribute = "nur_name" > </order>
< filter type = "and" >
<condition value="{{request.params.id}}" attribute = "nur_parametersinjson" operator = "like" > </condition>
< /filter>
< /entity>
< /fetch>
{% endfetchxml %}
{% endif %}
3. Now write the script on click of the button as below.
$(function () {
window.history.pushstate(null,null,location.origin + location.pathname);
$("#btnSubmit").on('click',function(){
var origin = location.origin; var args = location.search;
varpath = location.pathname;
location = origin + path + args + ((args =="") ? '?' : '&' ) + 'id=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX';
});
});
4) Here you will add your logic as -if results.entities.size is greater than 0 then redirect the user to another page.
Hope this helps!
Thanks