Hi Pratim Das, Partha C I want to help you with this question.
To verify I understand your question correctly, you want to create a logic app that will be triggered by an HTTP request, execute a stored procedure afterward, store the result as JSON in a SharePoint list or something, and fetch the link of it to send it via email at the end. Is that right?
These are the steps I would do here:
HTTP Triggered Logic App: Create a new Logic App in your Azure portal. Set up an HTTP trigger to start the workflow when an HTTP request is received.
Connect to Azure SQL Database: Add an action to connect to your Azure SQL Database. Provide the necessary connection details (server name, database name, credentials).
https://learn.microsoft.com/en-us/connectors/sql/
Execute Stored Procedure: Add an action to execute your stored procedure. Specify the stored procedure name and any required parameters.
https://learn.microsoft.com/en-us/connectors/sql/#execute-stored-procedure-(v2)
Format Result as JSON: Use the FOR JSON PATH clause in your SQL query to format the result as JSON directly within the query.
SELECT CustomerName AS Name, PhoneNumber AS [Contact.Phone], FaxNumber AS [Contact.Fax]
FROM Sales.Customers
WHERE CustomerID = 931
FOR JSON PATH, WITHOUT_ARRAY_WRAPPER
This will return a single JSON object instead of an array.
Store JSON in SharePoint: Add an action to create an item in SharePoint.
Use the formatted JSON result from the previous step as the content of the item.
https://learn.microsoft.com/en-us/connectors/sharepointonline/#create-item
Get File URL: Retrieve the URL of the created item in SharePoint.
You can use the output from the previous action to get the file URL.
Send Email with File Link: Add an action to send an email. Include the SharePoint file URL in the email body.https://learn.microsoft.com/en-us/connectors/office365/#send-an-email-(v2)
I hope this will help you to create the logic app
If the reply was helpful, please don’t forget to upvote or accept it as an answer, thank you!