Thanks Nya, I found the solution which I will discuss here. First of all, I just need to hihghlight that in implicit object enitities, one must provide a primary key of to fetch the record, i.e. recordid in entities['entityname']['recordid'] must be a primary key value.
Anways, to get the draft record saved in the entity of a WebForm or AdvanceForm (both are same), we need the primary key of that draft record first. And that can be retrieved from adx_primaryrecordid column of the adx_webformsession table.
since there are multiple session records in adx_webformsession table itself, so we need to get the session record which is associated with draft record of the entity of a WebForm. We know a WebForm stores its configuration record in adx_webform table, we can access configuration record id using page.adx_webform.id. Don't assume here, that now can run liquid template entities['adx_webformsession'][page.adx_webformsession.id] to get session record because page.adx_webformsesion.id on page level in liquid template doesn't refer to primary key of adx_webformsession table and I did this mistake in my case, therefore we need to run fetchxml as follows and directly just get the required attribute from the session record i.e. adx_primaryrecordid discussed above :
{% fetchxml webformsessions %}
<fetch top="1">
<entity name="adx_webformsession" >
<attribute name="adx_primaryrecordid" />
<attribute name="adx_primaryrecordentitylogicalname" />
<filter type="and" >
<condition attribute="adx_webform" operator="eq" value="{{ page.adx_webform.id }}" />
<condition attribute="adx_contact" operator="eq" value="{{ user.id }}" />
</filter>
<order attribute="createdon" descending="true" />
</entity>
</fetch>
{% endfetchxml %}
{% for item in webformsessions.results.entities %}
{% assign recordid = item.adx_primaryrecordid %}
{% endfor %}
Now, that we have recordid , we can get the draft record of the WebForm using entities['entitityname']['recordid']
Note that, if above fetchxml doesnt return result it means you might not have permissions in Table Permissions confiuration of the Dynamics Portal. I faced this issue and I coudln't get my head around for hours to find the actual cause. So I added the Table Permissions record as follows:
Name: WebFormSession-Permission-Contact (Can be anything)
Access Type: Contact
Table Name: adx_webformsession
Web Roles: Authenticated User, Administrator (these are the roles in my case, use your own roles who you want to give the permissions to)
Permissions: ReadOnly