cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dlprentice
Responsive Resident
Responsive Resident

How to match a string against one or more values in an array?

Lets say I have a string like this:

 

BLMBORNX-R1LULU-N887518E002 (or even a partial string like BLMBORNX-R1LULU-)

 

I want to match this up with values in an array. However in the array there could be more than one match (which is ok)

 

Lets say the closest match is this:

 

  {
    "City""HONOLULU",
    "State""HI",
    "Network ID""blmbornx-r1lulu-bdosoooo22"
  },
  {
    "City""HONOLULU",
    "State""HI",
    "Network ID""blmbornx-r1lulu-Ndo9f-3iu0920jf"
  },
 
My desired output would be:
 
Most likely locations based on BLMBORNX-R1LULU-N887518E002:
 
CityStateNetwork ID
HONOLULUHIblmbornx-r1lulu-bdosoooo22
HONOLULUHIblmbornx-r1lulu-Ndo9f-3iu0920jf

 

This is what I got so far:

Screenshot 2021-01-29 082820.png

 

JSON Format of array:

{
    "type""array",
    "items": {
        "type""object",
        "properties": {
            "City": {
                "type""string"
            },
            "State": {
                "type""string"
            },
            "Network ID": {
                "type""string"
            }
        },
        "required": [
            "City",
            "State",
            "Network ID"
        ]
    }
}
1 ACCEPTED SOLUTION

Accepted Solutions
ManishJain
Solution Sage
Solution Sage

Hi @dlprentice ,

 

You can use Filter array action to filter out the array with your filter you want. eg. for your case the input will be the array you are looking to filter and in the filter condition 

 

item()?['network id'] is equal to 'string comparison'

 

this will give you array as an output if matched else empty array which you can use further to create CSV table or HTML table.

 

Thanks

View solution in original post

1 REPLY 1
ManishJain
Solution Sage
Solution Sage

Hi @dlprentice ,

 

You can use Filter array action to filter out the array with your filter you want. eg. for your case the input will be the array you are looking to filter and in the filter condition 

 

item()?['network id'] is equal to 'string comparison'

 

this will give you array as an output if matched else empty array which you can use further to create CSV table or HTML table.

 

Thanks

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,309)