Hi @Tushar Lakhotia ,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here. I apologize for any inconvenience caused on this.
As, I am providing an alternative workaround which might help you in resolving your issue.
- In Logic Apps, the Thread ID is the ID of the thread the message belongs to, while the Message ID is unique to each email. When using the Gmail connector, both the Thread ID and Message ID are available, but the Thread ID remains the same for all emails in the same conversation thread12. This can be useful for identifying replies, Since the Conversation ID and Message ID are different for parent and reply to emails, you can use the Thread ID as a common key to link emails in the same conversation. This way, you can maintain the chain in your database by updating the record with the same Thread ID.
- Ensure that your Logic App is configured to capture the Thread ID from incoming emails. You can then use this Thread ID to check if an email is a reply to an existing conversation and update the corresponding record in your database.
Below is the step-by-step process to Use Thread ID in Logic Apps
- Go to the Azure portal and navigate to "Logic Apps" and click on "Add" to create a new Logic App and fill in the required details and click "Create", Once your Logic App is created, open it and click on "Blank Logic App" and add a trigger by searching for "When a new email arrives" to configure the trigger to capture incoming emails.
- After that add a new step to your Logic App by clicking on "New step" here search for "Compose" and add it, in the "Inputs" field, add the dynamic content for Thread ID from the email trigger because this will capture the Thread ID of the incoming email again add a new step to your Logic App by clicking on "New step" and search for your database connector (e.g., SQL Server, Azure Table Storage) and add an action to "Get rows" or "Query" and configure the action to check if the Thread ID exists in your database.
- Again, add a condition to your Logic App by clicking on "New step" and then "Condition" here set the condition to check if the Thread ID exists in the database. If Yes: Update the existing record with the new email body. If No: Insert a new record with the email details and Thread ID.
For the Yes branch of the condition, add an action to update the existing record in the database with the new email body and for the No branch of the condition add an action to insert a new record in the database with the email details and Thread ID.
I hope this addresses your query. If you have any further questions or concerns, please feel free to reach out to us.