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
Hi @Anonymous :
Could you tell me:
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. I’ve made a test for your reference:
1\My data source
2\My Flow
3\The Result
Best Regards,
Bof
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.
so what I'm stuck at is filtering based on this criteria
Best,
Rulatech
Hi @Anonymous :
Please try:
On your side,the code might be:
item()?['Multiselectionfield']?[0]['Value']
Best Regards,
Bof
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 @Anonymous :
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
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 @Anonymous :
I still feel a little confused.
Could you provide some screenshots of your flow?
Best Regards,
Bof
Hi @Anonymous :
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
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
8 | |
7 | |
6 | |
6 | |
5 |