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 / Assign dynamic collect...
Power Apps
Unanswered

Assign dynamic collection column values to variables and fill empty string if collection rows less than a number

(0) ShareShare
ReportReport
Posted on by

So, the title might be very confusing. I will try to explain best. I have a collection where users are adding batches. The interface looks something like this:

 

image.png

 In the Sharepoint list, I have 10 columns each of the 3 variables: Batch, Packaging, and unique ID. The user can input upto 10 batches but often it is much less. I want to supply empty strings to remaining columns if user doesn't add all 10 batches

 

This is what my add batch looks like:

 

 

Collect(
 BatchMVC,
 {
 CBatchNumber: BatchNumberInput.Text,
 CPackaging: PackagingDropdown.Selected.Value,
 CUniqueID: UniqueIDInput.Text
 }
);
Set(ID,ID+1);
Set(BatchNos,Concat(BatchMVC,CBatchNumber & ","));
Set(Packaging,Concat(BatchMVC,CPackaging & ","));
Set(UniqueID,Concat(BatchMVC,CUniqueID & ","));

 

 

image.png

 

This is what my sharepoint list looks like, for U also similarly there are 10 columns

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Please help in how I can assign empty strings to column in case user doesn't add 10 batches

Categories:
I have the same question (0)
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @RaghavCh 

     

    Would your use case suit a scenario, where rather than have 10 different columns which will be partially filled resulting in a lot of gaps in your backend data, to potentially just have 1 column for the batch reference and add a row per batch added. If certain batches in the potential 10 are not selected, you end up with no gaps and you can use power apps to filter and display this info how you like?

     

     

  • LukasKo Profile Picture
    25 on at

    Hi @RaghavCh ,

     

     why do you need to assign empty strings and null is not enough? I am asking because if it's not specifically the empty string, you could use SharePoint column default value functionality (e. g. set default value to "N/A" string) and call Patch function with defaults, so that only your batches are filled and "N/A" string set for the rest. But it can't be an empty string.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard