cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RussellGove
Kudo Kingpin
Kudo Kingpin

sharepoint trigger 'When an Item is created or modified' does not return ID

Hi, I'm trying to use the trigger mentioned in the title. The first thing i want to do is get prior versions of the changed item by making a sharepoiint rest call. But the trigger does not expose the ID of the item that was just modified? How are we supposed to work with it without an Id.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @RussellGove,

 

I think there is something issue with the Uri that you specified within the Uri field of the "Send an HTTP request to SharePoint" action.

 

In addition, the text() function is not supported in expressions of Microsoft Flow currently. More details about the expressions supported in Microsoft Flow currently, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

 

I have made a test on my side and please take a try with the following workaround:20.JPG

The flow works successfully as below:23.JPG

 

 

If you could not find the ID dynamic content of the trigger, please consider take a try to click "See more" button within the "When an item is created or modified" trigger section of right Dynamic content tab, then check if the ID dynamic content has been shown up:21.JPG

 

 

In addition, you could also type the following formula within the Uri field of the "Send an HTTP request to SharePoint" action:

_api/web/lists(guid'7adab573-9d27-4129-abc0-faca0ae45fe8')/items(@{triggerBody()?['ID']})/versions

22.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
RussellGove
Kudo Kingpin
Kudo Kingpin

I think ist because the ID is a number and Im trying to use it in the url for a 'Send http request'

I tried to fix it by converting the id to text like this:

Capture.PNG

but now i get an error saying Unable to process template language expressions in action 'Send_an_HTTP_request_to_SharePoint' inputs at line '1' and column '2334': 'The template function 'text' is not defined or not valid.'.

 

any ideas?

v-xida-msft
Community Support
Community Support

Hi @RussellGove,

 

I think there is something issue with the Uri that you specified within the Uri field of the "Send an HTTP request to SharePoint" action.

 

In addition, the text() function is not supported in expressions of Microsoft Flow currently. More details about the expressions supported in Microsoft Flow currently, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

 

I have made a test on my side and please take a try with the following workaround:20.JPG

The flow works successfully as below:23.JPG

 

 

If you could not find the ID dynamic content of the trigger, please consider take a try to click "See more" button within the "When an item is created or modified" trigger section of right Dynamic content tab, then check if the ID dynamic content has been shown up:21.JPG

 

 

In addition, you could also type the following formula within the Uri field of the "Send an HTTP request to SharePoint" action:

_api/web/lists(guid'7adab573-9d27-4129-abc0-faca0ae45fe8')/items(@{triggerBody()?['ID']})/versions

22.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, I never noticed that See More button. I click that and I can get the ID.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,886)