cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
leyburn19
Level 10

Collection and SharePoint

1. When I create a collection in SharePoint list based on a filter,  I get a result but also get all columns from the list.  I only want one column.  I cannot seem to get just that.  Any Ideas?

 

2. When I get the result I then want to reduce it further by filtering out recordes that match another list (collection).  . The aim is to create a drop down for the user that only see the results,  negating them from picking something they should no lonegr be able to. Any Ideas?

 

To gove you full picture,  this is a vehicle bookings APP where the full fleet by site in one Lists and Bookings are stored in another.  I want new bookings to only be allowed to select a vehicle that is not booked yet

1 ACCEPTED SOLUTION

Accepted Solutions
leyburn19
Level 10

Re: Collection and SharePoint

OK I solved my issue.  I needed to create two collections.   One based on the completed list of Veh and one base on those veh booked based on a filtered date.  Using Forall I then removed all matching records from the Main Veh collection.   This then gave me the result of only a list of vehicles available in the period.  This also soved my probles of how to create a collection based on one column in a share point list.  The Forall became the key in the whole process.  Things I also noted was ClearCollect cannot be used in a Forall.  You alos cannot use removeIF if the Forall is based on the same datasource

 

This was the syntax below:

 

Clear(AllV);Clear(AllB);

ForAll(Bookings,If(DateTo<=Today(),Collect(AllB,{Rego1:Rego})));

ForAll('CAT 2 Defence Vehicle List',If(IsBlank(Title)=false,

Collect(AllV,{Rego2:Title})));

ForAll(AllB,RemoveIf(AllV,Rego2=Rego1))

View solution in original post

11 REPLIES 11
Super User
Super User

Re: Collection and SharePoint

Hey @leyburn19

 

 

Do you have a field in your SharePoint list that contains whether the vehicule is booked or not (Yes/No field)?

Then you can easily solve your issue to filter on booked vehicules.

If you could also provide so screenshots of your app that you already have so we can understand a bit more what you want to achieve would be great.

 

Kind regards

 

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





leyburn19
Level 10

Re: Collection and SharePoint

The bookings List does,  but it is not practical to do that in the main vehicles list as booking date to and froms are variable.  A vehicle could be free one day and not the next.  So In order to get the non booked on a particular dates I need to to address this aspect.

 

Thanks for your prompt reply.

 

I simply a forall would work in mosts case in DB I have worked with,  but in this case I cannot seem to get any syntax that that would match two collections where Collection one in all Veh whice is reduces by the booked vehicles in collection two.

 

Does that make sense?

 

My logic so far is to create a collection that is based on the Master vehicles but fileterd to the site they are at.  The second collection takes the date of the booking request and shows vehicles booked on that day.  Now I am trying to reduction Collection one by removing those vehicles from its collection. This result would then be used to create a dropdown where the user selects for their new bookings.

 

I am stumbling as well over the Collection of the master Vehicles.  I only want it to show the one column from the sharepoint list but I get all of them.

leyburn19
Level 10

Re: Collection and SharePoint

Capture1.PNGHer are a couple of screenshots.  Screen 1 is the master caledar that reflect all bookings to date.  Screen two shows the add new booking.  At the moment teh drop down will allow a user to selecte unbooked veh.  This is what I am trying to prevent

 

Capture1.PNGCapture2.PNG

Super User
Super User

Re: Collection and SharePoint

Hey @leyburn19

 

 

I get the most of it where you want to go with this. I think you can use a Filter or a Search function to look for the column when you collect your data into your collection so you only collect that one column. I didn't work alot with collection myself but I guess that can be done.

So if I understand it correctly you need to sort on the to and from date when this is filled in?

 

You mean that you want to prevent that a user can select a booked vehicule right?

 

Kind regards

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





leyburn19
Level 10

Re: Collection and SharePoint

You mean that you want to prevent that a user can select a booked vehicule right? Yes

 

I can accept all columns in acollection OK,  but as I undertand the remove function in a collection needs to match all teh Columns exactly.  This is massive and not really achievable based.  I thought if I narrowed to two list to the simple veh rego,  it would be the solution.  Not there yet.

Super User
Super User

Re: Collection and SharePoint

Hey @leyburn19

 

 

Can't you use Filter or Search instead of Remove?

The Filter or Search will just "hide" the results that dont need to be shown. 

Also it is already a nice app. Nicely done!

 

Kind regards

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





leyburn19
Level 10

Re: Collection and SharePoint

Yes but how do you dynamically hide rows based on a result or a filter in another list.  I cannot find syntax that does domething like (in its simplest form)

 

filter(datasource1,datasource1.Field<>Datasource2.field)

Super User
Super User

Re: Collection and SharePoint

@leyburn19

 

 

Yes that's indeed a good question, I will have to dig deeper into this issue.

I will let you know if I find something that can be of use for you.

 

Kind regards

 

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





leyburn19
Level 10

Re: Collection and SharePoint

Pending the solution I am after for this,  I did create a simple work around.  When the user selcts a veh rego from the drop down,  it checks if it is booked and if so tells the user so.  

 

It would still have been good to have a solution where only non booked veh are in the list

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,153)