cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yerlasdutco
Helper III
Helper III

Create collection with custom column

Hi Folks,

 

I created 2 lists on sharepoint. 

Yerlasdutco_0-1654520384762.png

I need to create Collection with 2 columns: New_tagnumber : table1.newtagnumber; and Status column, that will be Complete if Table2.new_tagnumber existing in Table1.new_tagnumberid, else "Non complete"

1 ACCEPTED SOLUTION

Accepted Solutions
Waegemma
Super User
Super User

Hi @Yerlasdutco ,

 

This should work (tested it several times 🙂 )

 

 

 

 

ClearCollect(colInit, ShowColumns('TagNumber table', "new_tagnumberid"));
ClearCollect(colStatus, AddColumns(colInit,"Status"; "Non Complete"));
UpdateIf(colStatus, new_tagnumberid in 'Drawing table'.new_tagnumber, {Status: "Complete"})

 

 

 

 

Grtz,

 

Marc

 

If it does the job, please accept this as a solution.

View solution in original post

6 REPLIES 6
Waegemma
Super User
Super User

Hi @Yerlasdutco ;

 

This should get you a collection (colStatus) that has the newtagnumbers from table2, and a status linked to the presence these newtagnumbers in table1:

 

 

 

ClearCollect(colInit,ShowColumns(table2, "newtagnumber"));
ClearCollect(colStatus,AddColumns(colInit,"Status", If(IsEmpty(LookUp(table1, newtagnumberid = ThisRecord.newtagnumber)),"Non Complete","Complete")))

 

 

 

 

Marc

I received Error: 

Yerlasdutco_0-1654528286493.png

my code is:

ClearCollect(colInit,ShowColumns('TagNumber table', "new_tagnumber"));
ClearCollect(colStatus,AddColumns(colInit,"Status", If(IsEmpty(LookUp('Drawing table', 'TagNumber table'.new_tagnumberid = 'Drawing table'.new_tagnumber)),"Non Complete","Complete")))

what is problem here?

Waegemma
Super User
Super User

Hi @Yerlasdutco ,

 

Presuming you want to check if a new_tagnumberid from the 'TagNumber Table' has an entry in the 'Drawing Table':

 

ClearCollect(colInit,ShowColumns('TagNumber table', "new_tagnumberid"));
ClearCollect(colStatus,AddColumns(colInit,"Status", If(IsEmpty(LookUp('Drawing table', new_tagnumber = ThisRecord.new_tagnumberid)),"Non Complete","Complete")))

 

Marc

@Waegemma 

No success, If(IsEmpty(LookUp can't compare column from different tables

 

Any other ways to compare?

Waegemma
Super User
Super User

Hi @Yerlasdutco ,

 

This should work (tested it several times 🙂 )

 

 

 

 

ClearCollect(colInit, ShowColumns('TagNumber table', "new_tagnumberid"));
ClearCollect(colStatus, AddColumns(colInit,"Status"; "Non Complete"));
UpdateIf(colStatus, new_tagnumberid in 'Drawing table'.new_tagnumber, {Status: "Complete"})

 

 

 

 

Grtz,

 

Marc

 

If it does the job, please accept this as a solution.

@Waegemma 

 

Great, Thank you.

 

I made some changes, but works well

Yerlasdutco_0-1654676969713.png

 

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 (3,051)