web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Fill entire column wit...
Power Apps
Answered

Fill entire column with same value

(0) ShareShare
ReportReport
Posted on by 38

Hello,

 

I am making an app that does.. well, a lot of stuff, but right now Im somewhat stuck with this problem. 

I am trying to make a list of items "owned" by a name (string).

I have this collection:

 

 

item 1
item 2
item 3
...

 

 

  What I want to do is to insert a column with all the same name, like this:

 

 

itemID ownerID
item 1 bob 
item 2 bob
item 3 bob
... ...

 

 

 

I was hoping to achieve this with something like this:

 

 

ClearCollect(itemownerList,
 ShowColumns(VelgDP.AllItems, "itemID") 
);
//And then I had hoped one of these 2 would do the trick. But they don't even work. 
AddColumns(itemownerList, "ownerID", "bob");

ForAll(itemownerList, { ownerID: "bob"} );

 

 

Is there any way at all to simply set all values in a column to a set string or string variable?

This woule be easier if it was a Lookup from another collection or something, but this seems so simple that it's not possible..


At first i thought this ( https://powerusers.microsoft.com/t5/Building-Power-Apps/Adding-a-column-and-filling-with-same-value-to-a-collection/td-p/2188600 ) problem sounded similar, but his solution is nothing like my problem as what he actually wanted is to fill a collection from a list.

Any help for this seemingly simple problem?

 

 

Categories:
  • Verified answer
    shoog Profile Picture
    2,164 on at

    You're not storing the output of AddColumns anywhere right now. It will work if you add it to the collect:

    ClearCollect(itemownerList,
     AddColumns(ShowColumns(VelgDP.AllItems, "itemID"),"ownerID", "bob")
    );

     

  • suppeboi Profile Picture
    38 on at

    Thank you so much! 

     

    Apparently, it came down to me not knowing how AddColumn actually works. 

     

    I hadn't realized it returned a collection, i thought it just added the column in-place, and worked "in between" ClearCollect() and ShowColumns(). 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard