cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver III
Resolver III

Way to check if title in a list

Hello All,

 

I have built a flow to go along with my powerapp.  It collects  all lists and document libraries in a sharepoint site and sends them back to powerapps.

 

I originally did this by hardcoding the If statement to say   IF title = name1 ; put it in the list to be returned to powerapps ; etc.   (hardcoded each list that DID have to go back to powerapps into the if statement) here is a pic to give an impression of the current working: listadding.PNG

 

Now i am looking to adapt this to make it more adjustable for end users, so my idea was to use a list (lets call it the management list) in which a dedicated person can manage which libraries should be returned to the power apps and which not  (by having my flow check if the name of the list/library is in the management list).

 

However i am having a bit of a rough time envisioning how this should work.

I do 'get items' from the management list aswel as 'get all lists/libraries from a site'.

Also im pretty sure I will need to do an 'apply to all' nested in another 'apply to all' but things are getting kind of confusing for me once i start to envisioning how the data gets processed.

 

If anyone could help me out in any way, that would be great.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Hi!

My suggestion is first to create a dictionary with 'Library Names' stored on your Sharepoint list

I would add an Initialize Variable Action block, let's name it 'myLibraryList', type Array, value empty

Next, I would addan 'Apply to each', assign as its input 'Get items' output. Now inside your 'Apply to each' I would add an 'Append to array' action block, name 'myLibraryList', assign as its value the column from your SP list where you store the Library Name.

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

6 REPLIES 6
Highlighted
Dual Super User III
Dual Super User III

Hi!

My suggestion is first to create a dictionary with 'Library Names' stored on your Sharepoint list

I would add an Initialize Variable Action block, let's name it 'myLibraryList', type Array, value empty

Next, I would addan 'Apply to each', assign as its input 'Get items' output. Now inside your 'Apply to each' I would add an 'Append to array' action block, name 'myLibraryList', assign as its value the column from your SP list where you store the Library Name.

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted

Thanks for the suggestion! i can see how this will help me out.  I'll mark your answer as a solution as soon as i actualy completed my flow

 

Thanks a million !!

Highlighted

@efialttesyour answer has certainly pushed me in the right direction however I am experiencing an issue I didn't expect to get.

Perhaps you or anyone else has a good idea about it.

 

My flow looks like this now:

flow123.PNG

 

The content of the apply to each blocks:

eachblocks.PNG

 

So what is going on now?

I initialze a csv string variable to return to power apps. it will contain all library names as "libraryName,libraryName2,libraryName3".

 

Then an array is initialized called myLibList. All "Allowed" library names will be stored in here for later comparison, gathered from a sharepoint list created in order to manage allowed libraries.

 

3rd I get all lists and libraries from SP. 4th I get all items from the SP list with the names of the allowed libraries.

 

Then For Each item in Allowed Libraries List append library name to myLibList

 

Lastly, and here is where it goes wrong:

For Each item in All lists and libraries
{
    If myListLib Contains name ; append Displayname to returnValue //(csv string variable)
}
Else {
nothing
}

unsuccesful.PNG

 

myLibList seems to get filled with at least the exactly right names however my condition check 'myLibList [contains] name' never seems to end in true thus never appending anything to the csv string.  Any suggestions are appreciated.

Highlighted
Dual Super User III
Dual Super User III

Hi!

Just for troubleshooting purposes, I would do the following:

-Add a dummy compose action block just before the Condition action block, assign as its input the same 'Name' dynamic content you use in your Condition

-Add a second dummy compose action block just before before the Condition action block, assign as its input the same array variable dynamic content you use in your condition

Reexecute the flow and inspect Compose outputs. Please note 'Apply to each' iterates over N elements, you can inspect both Compose output per iteration just clicking on 'Next'

Flow_ApplyToEach_Arrows.PNG

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted

@gjeh 

Issue solved, right?

If so, CONGRATS!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted

Yes it is completed thanks to your wisdom. thanks a million!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (7,277)