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

Colection from sharepoint Lists

Hi

 

I have a collection that gets all RefIDProj from an user.

It's showwing RefIDProj, Busca (email from user) and it's showing all other columns from user. Is that possible to show only email?

 

Collect(MyPeople; AddColumns(Filter(ProjEquipe;Integrante = Lower(ThisItem.Mail)).RefIDProj;"Busca";Lower(ThisItem.Mail))

 

where: ProjEquipe - sharepoint list with RefIDProj and user of project

RefIDProj       Integrante

1                   alessandramacedo@xxxx.com

2                   raphael@xxxx.com

3                   mario@xxx.com

 

 

 

And I need to then collect from another list all data form projects that has same RefIDProj from this collection.

Is that possible?

 

Sharepoint list = ProjProjetos

IDProj(same as RefIDProj)           ProjectName              Description

1                                                  Project1                      DProject1                      

2                                                  Project1                      DProject2                      

3                                                  Project3                      DProject3                     

 

Collection MyPeople

RefIDProj             Integrante                                         ProjectName           Description

1                          alessandramacedo@xxxx.com          Project1                   DProject1                      

2                          raphael@xxxx.com                            Project2                      DProject2                      

3                         mario@xxx.com                                  Project3                      DProject3 

 

 

 

Thanks in advance

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

OK, I tested this version on my side and it seems to work. I forgot nested ForAll statements don't like to operate on the same table:

ClearCollect(MyPeople,
    ForAll(Search(ProjEquipe, txt_Inp1.Text, "Integrante") As aRecord,
        {
        ReflDProj: aRecord.RefIDProj,
        Integrante: aRecord.Integrante,
        ProjectName: LookUp(ProjProjetos, IDProj = aRecord.RefIDProj, ProjectName),
        Description: LookUp(ProjProjetos, IDProj = aRecord.RefIDProj, Description)
        }
    );
);
_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
BCLS776
Super User
Super User

If I understand correctly, you want to combine selected columns from the ProjEquipe and ProjProjetos lists into a single collection named MyPeople. If so, try this:

ClearCollect(MyPeople,
    ForAll(ProjProjetos as aRecord,
        {
        ReflDProj: aRecord.IDProj,
        Integrante: LookUp(ProjEquipe, ReflDProj = aRecord.IDProj, Integrante),
        ProjectName: aRecord.ProjectName,
        Description: aRecord.Description
        }
    )
)

Hope this helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Hi Bryan almost this

 

This collection is set up in on select of a textbox where I put a email for search.

What I want to say is that the collection must filter all records from projects (sharepoint list ProjProjeto) where this user (textsearch) is part of team (team is in sharepoint list ProjEquipe). When I put an email in this textsearch than will collect all projects from the user.

Is that possible to include this?

Yes, you can do this too - it's a step more complicated. Assuming you have a text box called "txt_Inp1", try this code:

Clear(MyPeople);
ForAll(Search(ProjEquipe, txt_Inp1.Text, "Integrante") As aSearch,
    ForAll(aSearch As aRecord,
        Collect(MyPeople,
        {
        ReflDProj: aRecord.RefIDProj,
        Integrante: aRecord.Integrante,
        ProjectName: LookUp(ProjProjectos, IDProj = aRecord.RefIDProj, ProjectName),
        Description: LookUp(ProjProjectos, IDProj = aRecord.RefIDProj, Description)
        }
        )
    )
);

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Didn't work. 

Clear(MyPeople);;
ForAll(Search(ProjEquipe;Title2_4.Text;"Integrante") As aSearch;
ForAll(aSearch As aRecord;
Collect(MyPeople;
{RefIDProj: aRecord.RefIDProj;
Integrante: aRecord.Integrante;
NomeProjeto: LookUp(ProjProjeto; IDProj = aRecord.RefIDProj; NomeProjeto);
UnidadeGestora: LookUp(ProjProjeto; IDProj = aRecord.RefIDProj; UnidadeGestora)
}
)))

 

Says ForAll has invalid arguments, don't know why

Here in Brazil we use ";" instead ",".  (i did the changes).

BCLS776
Super User
Super User

OK, I tested this version on my side and it seems to work. I forgot nested ForAll statements don't like to operate on the same table:

ClearCollect(MyPeople,
    ForAll(Search(ProjEquipe, txt_Inp1.Text, "Integrante") As aRecord,
        {
        ReflDProj: aRecord.RefIDProj,
        Integrante: aRecord.Integrante,
        ProjectName: LookUp(ProjProjetos, IDProj = aRecord.RefIDProj, ProjectName),
        Description: LookUp(ProjProjetos, IDProj = aRecord.RefIDProj, Description)
        }
    );
);
_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Now Did it great.

Thank you!!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,928)