Hi @Baburaj Parappilly Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
Looks like there is no straight forward approach to change the URL of the Logic App connector dynamically. You can explore the option to Use custom code support in your connector which lets you transform requests and response payloads beyond the scope of existing policy templates. Transformations include sending external requests to fetch additional data. When code is used, it will take precedence over the codeless definition. This means that the code will execute, and the request won't be sent to the back end.
Please refer the sample Forwarding and transform script which forwards the incoming request and transforms the response returned from the backend. Please note that this approach has a limitation that script must finish execution within 5 seconds and the size of your script file can’t be more than 1 MB. Please refer to Custom Code FAQ for more details.
Alternatively, if you consider using Power Platform, there is an easy way to Set Host URL for custom connectors. Please refer a sample implementation that uses the parameter x-ms-apimTemplateParameter.urlTemplate
to specify the host URL in the following GitHub sample
Hope this helps! Please let us know if you have any additional questions or need further clarification.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.