Apologies, I keep answering with questions but I have a few more 😂
"the same subgrid is used to create attachments, this subgrid is added as metadata from advance form."
- if you want separate subgrids, you can add multiple subgrids to the form and manipulate the metadata for each one to have different actions, not sure if that's what you mean
would you have a mock page of what you are trying to achieve, I still can't visualize
"The liquid is in webtemplate which is associated with Home Webpage."
Is your Advanced Form associated with the home page? please note that your Fetch will execute every time the home page is loaded, this might bring your site performance down
"var id = $('#EntityFormView_EntityID').val();"
this is executed client-side, but your Fetch is being executed server-side, so you can't retrieve that at that stage
"but the result is from Advance Form, where the attachments are from basic form, which are added as metadata to the advance form"
I am either getting more confused again or maybe understanding this better.. are the Attachments a modal/basic form within your Advanced Form? or are they an Advanced Form Step itself? can you share a snapshot?
"On advance form, this step might be maintaining the ID, not sure, as there is an existing query which is still based on request.params.id and executes without any issue"
Can you share the URL structure?
any URL/snapshot you can hide any sensitive information, we just need to see structure of things so we can better assist you