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

Get items and listing them in a table based on the first selection in a multiple selection field?

Hello everyone ,

 

Is there a possible filtering option or solution to get items based on the first selected value in a multiple selection field given that I have created 4 parallel get items branches that filtering items based on selected value, but the field for some items contains more than 1 selected option so I don't want to list the item within more than one table. I want to list it based on the first selection I tried this function but it's not getting the needed result

 

first(body('Get_items')?['Value'])?['Multiselectionfield'] I appreciate your help

 

Regards, Rulatech

10 REPLIES 10
Community Support
Community Support

Hi @rula123 :

Could you tell me:

  • What is your data source? Is it a SharePoint List?
  • What is the multiple selection field? Is it a Choice column which allows multiple selections?

Do you want to get the first option in the Choice column field of each record?

If so , the key is to use [0] to extract the first item in the array. Ive made a test for your reference:

1\My data source

v-bofeng-msft_0-1605246244255.jpeg

 

2\My Flow

v-bofeng-msft_1-1605246244260.jpeg

 

3\The Result

v-bofeng-msft_2-1605246244275.png

Best Regards,

Bof

Frequent Visitor

Hello Bof,

 

Thank you for your help.

 

Apologies if my question was not clear, please note that the data source is sharepoint and my choice field name "ContentTypes"

let us say I'm selecting (choice 1,choice 2)

 

table 1 should contain items filtered based on selection of choice 1

table 2 should not contain the item even if choice 2 is selected 

Example 2: lets say I'm selecting choice 2, choice 3

table 2 should contain items filtered based on selection of choice 2

table 3 should not contain items filtered based on selection of choice 3 because it is not the first selection.

 

rula123_0-1605248104021.png

 

 

so what I'm stuck at is filtering based on this criteria 

 

Best,

Rulatech

 

 

 

Community Support
Community Support

Hi @rula123 :

Please try:

1.JPG

On your side,the code might be:

item()?['Multiselectionfield']?[0]['Value']

2.JPG

Best Regards,

Bof

Frequent Visitor

Hi @v-bofeng-msft 

Thank you.

 

unfortunately , this will still display the items within both tables especially that if I selected choice 1  id [0]and choice 3 id [2] , the flow is still adding the item under table 1 and table 3 which should list it only within table 1 because choice 1 was the first selection

 

here is the output:

 

"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 0,
"Value": "Choice 1"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 2,
"Value": "Choice 3"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 3,
"Value": "Choice 4"

 

waiting your reply , thank you 

 

Best,

Rulatech

 

Hi @rula123 :

Sorry I didn't understand what you mean.The following is my understanding, please help me point it out if there is an error:

1\You have a share point list

2\There is a choices column in the sharepoint list which allow mulitple selelctions.

3\The are many items in this list with multiple selections in there choices column.

4\You want to filter out the items whose first option in the choices column is ‘Choice 1’(Or some other option).

If my understanding is correct, then my above solution is feasible(I've made a test and it worked well). If my understanding is incorrect, could you point out my mistake and describe your needs in detail?

Best Regards,

Bof

 

Frequent Visitor

Hi @v-bofeng-msft ,

 

Hope you are doing well.

 

I really appreciate your valuable help. 

Your understanding is correct , but to be more clear I have 4 parallel branches of Get items filtering based on the first selection , 

 

Get items 1 - filtering based on choice 1 and listing the items within table 1

Get items 2- filtering if choice 2 is selected as first option( if choice 1 and choice 2 are selected - item should not be filtered as choice 2 item as  and should not be listed within table 2)

lets say contentTypes field in ITEM X value is (choice 1 and choice 2)

what I'm currently facing using the provided solution that ITEM X is filtered and listed within table 1 and table 2 

What I'm expecting is ITEM X listed only in table 1

 

I'm not sure if this information is important and sorry if I missed it ( ContentTypes Field is showing as checkboxes) 

 

Hope I'm giving a clear image now 

 

Best,

Rulatech

Hi @rula123 :

I still feel a little confused. 

Could you provide some screenshots of your flow?

Best Regards,

Bof

Frequent Visitor

Hi @v-bofeng-msft ,

 

Yes sure , Please find the below

 

rula123_0-1605509323558.png

Best ,

Rulatech

Hi @rula123 :

Should your Filter array5 be based on the results of Filter array7?

If this is the case, the "From" parameter of Filter array 5 must come from Filter array7.

Best Regards,

Bof

Frequent Visitor

Hi @v-bofeng-msft 

 

whether it's value or Body of filter it provides the same result.

 

Thank you

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (25,380)