cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Boynog
Helper II
Helper II

Replace in table

Hi Good day everyone!

 

How can I replace this the data within the collection table.

 

here's my current collection table 

    Group             Name                Age

colorredage
#N/A N/Aorange30
#N/A N/Ayellow27
#N/A N/Ablue57
numberone20
#N/A N/Atwo#N/A N/A
#N/A N/Athree#N/A N/A
foodkimchi43
#N/A N/Afried chicken20

 

This table below I want to achieve.

 

    Group              Name                Age

colorred38
colororange30
coloryellow27
colorblue57
numberone20
numbertwo20
numberthree20
foodkimchi43
foodfried chicken20

 

Thanks in advance everyone.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Boynog ,

 

According to your description, I've made a test for your reference:

 

1\ This is my collection ‘Test1’.

Add a button control and set its onselect property to:

ClearCollect(Test1,{Group:"color",Name:"reed",Age:"38"},{Group:"#N/A N/A",Name:"orange",Age:"30"},{Group:"#N/A N/A",Name:"yellow",Age:"27"},{Group:"#N/A N/A",Name:"blue",Age:"57"},{Group:"number",Name:"one",Age:"20"},{Group:"#N/A N/A",Name:"two",Age:"#N/A N/A"},{Group:"#N/A N/A",Name:"three",Age:"#N/A N/A"},{Group:"food",Name:"kimchi",Age:"43"},{Group:"#N/A N/A",Name:"fried chicken",Age:"20"})

 

2\ Add a button control and set its onselect property to:

ClearCollect(Test2,{Group:""});Clear(Test2);ClearCollect(Test3,{Age:""});Clear(Test3);ClearCollect(Test4,ForAll(Test1,If(!("#N/A N/A" in ThisRecord.Group),Collect(Test2,{Group:ThisRecord.Group}));If(!("#N/A N/A" in ThisRecord.Age),Collect(Test3,{Age:ThisRecord.Age}));If("#N/A N/A" in ThisRecord.Group&&"#N/A N/A" in ThisRecord.Age,{Group:Last(Test2).Group,Name:ThisRecord.Name,Age:Last(Test3).Age},"#N/A N/A" in ThisRecord.Group&&!("#N/A N/A" in ThisRecord.Age),{Group:Last(Test2).Group,Name:ThisRecord.Name,Age:ThisRecord.Age},If(!("#N/A N/A" in ThisRecord.Group)&&"#N/A N/A" in ThisRecord.Age,{Group:ThisRecord.Group,Name:ThisRecord.Name,Age:Last(Test3).Age},{Group:ThisRecord.Group,Name:ThisRecord.Name,Age:ThisRecord.Age}))))

 

3\ The result is as follows:

v-xiaochen-msft_0-1615775562420.png

 

// Test4 collection

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @Boynog ,

 

According to your description, I've made a test for your reference:

 

1\ This is my collection ‘Test1’.

Add a button control and set its onselect property to:

ClearCollect(Test1,{Group:"color",Name:"reed",Age:"38"},{Group:"#N/A N/A",Name:"orange",Age:"30"},{Group:"#N/A N/A",Name:"yellow",Age:"27"},{Group:"#N/A N/A",Name:"blue",Age:"57"},{Group:"number",Name:"one",Age:"20"},{Group:"#N/A N/A",Name:"two",Age:"#N/A N/A"},{Group:"#N/A N/A",Name:"three",Age:"#N/A N/A"},{Group:"food",Name:"kimchi",Age:"43"},{Group:"#N/A N/A",Name:"fried chicken",Age:"20"})

 

2\ Add a button control and set its onselect property to:

ClearCollect(Test2,{Group:""});Clear(Test2);ClearCollect(Test3,{Age:""});Clear(Test3);ClearCollect(Test4,ForAll(Test1,If(!("#N/A N/A" in ThisRecord.Group),Collect(Test2,{Group:ThisRecord.Group}));If(!("#N/A N/A" in ThisRecord.Age),Collect(Test3,{Age:ThisRecord.Age}));If("#N/A N/A" in ThisRecord.Group&&"#N/A N/A" in ThisRecord.Age,{Group:Last(Test2).Group,Name:ThisRecord.Name,Age:Last(Test3).Age},"#N/A N/A" in ThisRecord.Group&&!("#N/A N/A" in ThisRecord.Age),{Group:Last(Test2).Group,Name:ThisRecord.Name,Age:ThisRecord.Age},If(!("#N/A N/A" in ThisRecord.Group)&&"#N/A N/A" in ThisRecord.Age,{Group:ThisRecord.Group,Name:ThisRecord.Name,Age:Last(Test3).Age},{Group:ThisRecord.Group,Name:ThisRecord.Name,Age:ThisRecord.Age}))))

 

3\ The result is as follows:

v-xiaochen-msft_0-1615775562420.png

 

// Test4 collection

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

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.

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,226)