cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dlprentice
Helper V
Helper V

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

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,125)