Processing returned HTTP REST data

%3CLINGO-SUB%20id%3D%22lingo-sub-2193610%22%20slang%3D%22en-US%22%3EProcessing%20returned%20HTTP%20REST%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2193610%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20used%20Power%20Automate%20(actually%20it%20was%20written%20in%20Microsoft%20Flow)%20for%20a%20few%20things%2C%20but%20I%20think%20I%20need%20some%20help%20on%20how%20to%20handle%20HTTP%20requests.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Etl%3Bdr%3A%20How%20to%20I%20'extract'%20variables%20from%20a%20returned%20HTTP%20response%3F%26nbsp%3B%20(Got%20back%20a%20JSON%20object%2C%20how%20do%20I%20parse%20for%20a%20single%20variable%20to%20store%3F)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20overall%20process%20looks%20like%20this%3A%3C%2FP%3E%3CUL%3E%3CLI%3ETrigger%3A%20Item%20added%2Fedited%20in%20SharePoint%20List%20%26lt%3B--%20Got%20this%3C%2FLI%3E%3CLI%3EFilter%20for%20things%20that%20have%20already%20processed%20%26lt%3B--%20Got%20this%3C%2FLI%3E%3CLI%3ETake%20one%20of%20the%20fields%20and%20make%20a%20REST%20call%20to%20a%20web%20property%20(non-Microsoft)%20%26lt%3B--%20Got%20this%3C%2FLI%3E%3CLI%3EGet%20back%20a%20JSON%20blob%20containing%20a%20bunch%20of%20information%2C%20but%20specifically%2C%20I%20want%20a%20single%20entry%20(call%20it%20'UserID')%20%26lt%3B--%20Lost%20here%3C%2FLI%3E%3CLI%3EStore%20UserID%20in%20a%20variable.%20%26lt%3B--%20Pretty%20sure%20I%20got%20this%20part%3C%2FLI%3E%3CLI%3EUse%20UserID%20to%20perform%20another%20REST%20call%20to%20the%20same%20web%20property%20%26lt%3B--%20Still%20lost%3C%2FLI%3E%3CLI%3EExtract%20information%20from%26nbsp%3B%3CEM%3Ethat%3C%2FEM%3E%20returned%20JSON%20blob%20and%20update%20the%20SharePoint%20list%20item.%20%26lt%3B--%20Pretty%20sure%20I%20got%20this%20part.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EIf%20there's%20any%20resource%20that%20would%20be%20helpful%2C%20just%20point%20me%20in%20the%20right%20direction.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%3A%20I%20can%20do%20the%20REST%20stuff%20in%20PowerShell%20using%20the%20%60Invoke-RestMethod%60%20function%2C%20but%20I%20don't%20want%20to%20rely%20on%20someone%20running%20a%20script%20to%20do%20this%20if%20at%20all%20possible.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2193610%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Senior Member

I've used Power Automate (actually it was written in Microsoft Flow) for a few things, but I think I need some help on how to handle HTTP requests.

 

tl;dr: How to I 'extract' variables from a returned HTTP response?  (Got back a JSON object, how do I parse for a single variable to store?)

 

My overall process looks like this:

  • Trigger: Item added/edited in SharePoint List <-- Got this
  • Filter for things that have already processed <-- Got this
  • Take one of the fields and make a REST call to a web property (non-Microsoft) <-- Got this
  • Get back a JSON blob containing a bunch of information, but specifically, I want a single entry (call it 'UserID') <-- Lost here
  • Store UserID in a variable. <-- Pretty sure I got this part
  • Use UserID to perform another REST call to the same web property <-- Still lost
  • Extract information from that returned JSON blob and update the SharePoint list item. <-- Pretty sure I got this part.

If there's any resource that would be helpful, just point me in the right direction.

 

Note: I can do the REST stuff in PowerShell using the `Invoke-RestMethod` function, but I don't want to rely on someone running a script to do this if at all possible.

0 Replies