Power Automate Send an HTTP Request to SharePoint and Send Outlook Mail

Jairo Javier Baleta Cali 286 Reputation points
2023-10-17T19:20:46.3666667+00:00

Good afternoon.

Regards.

I'm currently building a workflow in Power Automate. Where it starts when you create an item in a SharePoint list:Captura de pantalla 2023-10-17 122327

An approval process then begins in which the element can be modified.

With the Power Automate element "Get changes for an item or file (properties only)" I check in the workflow if the information contained in the list record fields has changed:

Captura de pantalla 2023-10-17 140859

With the element "Send an HTTP request to SharePoint" I make a query with the parameter _api/web/lists/GetByTitle('list')/items('id')/versions?$filter=VersionLabel eq '2.0':

Captura de pantalla 2023-10-17 122705

And with the "Send mail V2" option an email is sent:

Captura de pantalla 2023-10-17 141114

In this process I have 2 main questions:

  1. In the "Send an HTTP request to SharePoint" option, how could I grab the latest version of the list item from SharePoint? I'm using _api/web/lists/GetByTitle('list')/items('id')/versions?$filter=VersionLabel eq '2.0', but it only takes the second version of the list item.
  2. I have not found which parameters to use in the "Send mail V2" option that reference the latest version of the list item referenced by the "Send an HTTP request to SharePoint" option.

I hope you can help me.

Thank you so much.

Cordially,

Jairo Baleta.

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
Microsoft Security Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2023-10-19T01:27:09.46+00:00

    Hi @Jairo Javier Baleta Cali ,

    I'm glad to hear you solve the problem, That's exactly what I was trying to say after checking with you. The ID generated by your trigger "When an item is created" is the ID of the latest version.

    By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others." and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:

    Current status:

    The issue has been solved. The solution is: This is the http request to get the most recent version of the item

    _api/web/lists/GetByTitle('{list title}')/items({id}). This will be the same as using Get Item

    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.