0

When I want to reference individual items of a list, I can use the ID easily. IDs are assigned for new items sequentially and unique.

However if I save an ID into a string variable to use it for other purposes I get a gibberish long thing which apparently contains the ID of the list and the internal ID.

e.g.:

e2db568a-8e97-4f73-b6f5-f9b395f8870c: 3

Of course I could split() the string to get rid of the list part, but it is perhaps a unsafe way not knowing the structure of the gibberish.

There must be a more easy way to access the integer. I assume I can access it directly by some ()?[] trickery.

1
  • What is the trigger of your flow? how you are setting value of variable? Apr 22, 2021 at 13:02

1 Answer 1

1

If you are using any one of the triggers of SharePoint Connector triggers, you can easily access list item ID using below expression:

@{triggerOutputs()?['body/ID']}

Also, you can select the ID property from dynamic content (as you are already doing it). Both above cases working perfectly fine for me while storing item ID in string variable.

Flow:

enter image description here

Output:

enter image description here


I have also tested using integer variable & it is giving results same as above screenshots.

2
  • perhaps I have to copy it into a variable first. I will check that along with your other comment.
    – Ariser
    Apr 22, 2021 at 17:03
  • Yes, use initialize variable action to save the ID. If string variable is not working then try using "integer" variable. Apr 22, 2021 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.