web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Comparing Share point ...
Power Automate
Unanswered

Comparing Share point list ID values to a list (passed as parameter from Power App)

(0) ShareShare
ReportReport
Posted on by 16

Hi,

 

I want to create a power app triggered flow that accepts a single column collection  A (containing primary key data) from a power app. 

The flow then needs to compare this collection A to a Share point list 1, and create new records in another Share Point list 2 but only for the records (in list1 ) which have a matching ID in collection A.

 

Can you please assist with the design of the flow as well as the condition to filter list1 (matching ID with collection A)

Categories:
I have the same question (0)
  • v-litu-msft Profile Picture
    on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    Hi @Laksh_05,

     

    Yes, please refer to the following screenshot:

    ColumnName eq 'value'

    Annotation 2020-05-19 141709.jpg

    Then it will return an array contains items which collectionA eq 'the value get from PowerApps'.

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Laksh_05 Profile Picture
    16 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    Hi @v-litu-msft ,

     

    I want to compare something like ID in CollectionA. can you please elaborate on how your filter condition would help?

     also, how did you get the dynamic expression collection, the only option I get is 'get from powerapps'

     

     

  • PVosEska Profile Picture
    329 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    The action from @v-litu-msft  will get you either the objects you seek, or return an empty value ( if the ID is not present)

     

    You can follow this up with a condition where on the left side you type an expression: 

    length(body('Get_items')?['value'])
     
    2020-05-19 08_48_03-Create your flow _ Power Automate.png

     

    That will check the output of the first action (get items). Items that do exist will have a string longer than 0 and will follow the 'if yes', if they don't the flow will follow 'if no'.
     
     
    Good luck!
     
     
  • Laksh_05 Profile Picture
    16 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    Hi @PVosEska ,

     

    Thank you for the reply. But I think my query is being misunderstood here.

     

    i am trying to figure out the OData Query i need to filter my list A.  ( see attached)

     

    The in operator is not working and the dynamic expression is not giving me the option to fetch the table from power app. its giving me some random option of getitems_filterQuery. 

     

    * the list name and address is intentionally removed.

     

    flow_help.JPG

  • v-litu-msft Profile Picture
    on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    Hi @Laksh_05,

     

    Could you please share an instance of the output from the powerApps trigger?

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Laksh_05 Profile Picture
    16 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    Hi @v-litu-msft ,

     

    Thanks for replying. I am clicking a button in PowerApps to trigger the flow.

     

    The button's onclick property has this code :   FlowName.Run(CheckedItems)

     

    Where CheckedItems is a single column table containing ID's

    e.g. 

    ID

    2

    3

    5

    7

     

     

  • PVosEska Profile Picture
    329 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    The 'GetItems_Filterquery' was created because you selected 'Ask in powerapps' in the dynamic content. everytime you click 'ask in powerapps' it will create a new name for the Dynamic Content

     

    instead of in, use the following OdataQuery: 

     

    ID eq '<GetItems_FilterQuery>'

    (Including the quotes.)

     

    If you then go to powerapps and select the flow you want to start, you will see the GetItems_filterquery as a parameter. select your collection in this parameter 

    Button1.OnSelect.FlowTrigger.Run(<Collection>)

  • Laksh_05 Profile Picture
    16 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    @PVosEska I tried and am getting an error in power apps:

     

    this is the filter query code in flow :

    ID eq '<GetItems_FilterQuery>'

     

    and this is the button's onselect code :

    abc.Run(CheckedItems)

     

    It is giving me an error in power apps saying invalid argument type. expecting a text value.

     

  • Verified answer
    PVosEska Profile Picture
    329 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    Hi @Laksh_05 ,

     

    I also ran into the same problem. We cannot pass collections (arrays) to Flow. What we could do is pass it as a string, and build it back into an array in flow.

     

     1. Use the following function in PowerApps to create a variable that contains all the ID's concatted in one string: Set(collectionToString,Concat(collection,Text(ID),";"))

     

    2. Then in flow, use the initialize variable and use the expression: split(triggerBody()['text'],';')}

    This will build an array (list) based on the separators (;).

     

    3. Create an apply to each with the value being the array

    4. create a compose with input 'current item'

    5.  create a get items with filter query being: ID eq '<current Item>'

     

    The flow then gets a string '1;2;3;4;5'

    will split it into an array 

    will check if for every id if is found in the sharepoint list.

     

    Extra info:

     

     

    ClearCollect(
    collection,
    {ID: 1},
    {ID: 2},
    {ID: 3},
    {ID: 4},
    {ID: 5}
    );
    Set(
    collectionToString,
    Concat(
    collection,
    Text(ID),
    ";"
    )
    )MyFlow.Run(collectionToString)

     

    2020-05-19 14_51_24-Edit your flow _ Power Automate.png

     
  • PVosEska Profile Picture
    329 on at
    Re: Comparing Share point list ID values to a list (passed as parameter from Power App)

    Hi @Laksh_05 ,

     

    Were you able to figure this out? I would like to know if this was a workable solution.

     

    Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard