cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Arshad80
Regular Visitor

Get IP Address in a string to call an API in the next step

Hi,

My flow is returning data in this format below, i just want to get each ip address in a for each loop so that i can use it in the step to call an API.

 

[
  "[\n  ",
  "172.21.43.10",
  ",\n  ",
  "189.75.212.28",
  "\n]\n\n[\n  ",
  "161.225.29.22",
  "\n]\n\n[\n  ",
  "169.225.222.243",
  "\n]\n\n[\n  ",
  "165.235.238.260",
  "\n]\n\n\n\n\n\n\n\n\n\n"
]

 

i just want each ip as a value so that i can call my API.

 

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

Like this should work:

https://ibb.co/9NghKqX

FilterIPAddresses.png

The output of the filter array is like this when it is executed:

FilteredIPAddresses.PNG

The expression in the filter array action is simply:

indexOf(item(), '.')

This filters the array to contain only those that contain a dot, which means there is an IP address there. You then have a clean array you can use in your foreach loop.

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

 

View solution in original post

4 REPLIES 4
Paulie78
Super User III
Super User III

Like this should work:

https://ibb.co/9NghKqX

FilterIPAddresses.png

The output of the filter array is like this when it is executed:

FilteredIPAddresses.PNG

The expression in the filter array action is simply:

indexOf(item(), '.')

This filters the array to contain only those that contain a dot, which means there is an IP address there. You then have a clean array you can use in your foreach loop.

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

 

View solution in original post

Thanks for your reply and i got array now; but i would like to get IP address for next step, this give me an array of IP's. how could this be break down in a single IP address for next step.

 

Thanks for your help

As I showed in my flow screenshot, you have an array, which is a list of IP Addresses, you then use them in an apply to each loop. Take another look at the screenshot I produced. Use the "body" of the array in the apply to each then you can access the IP address with the value of "item()"

 

Or do you want a single delimited string of IP addresses? Like:

 

172.21.43.10;189.75.212.28...

oh sorry i got it i was able to do it with your instructions.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,426)