cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dlprentice
Resolver I
Resolver I

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
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

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (30,257)