Showing results for 
Search instead for 
Did you mean: 
New Member

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

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:



 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:



        CBatchNumber: BatchNumberInput.Text,
        CPackaging: PackagingDropdown.Selected.Value,
        CUniqueID: UniqueIDInput.Text
Set(BatchNos,Concat(BatchMVC,CBatchNumber & ","));
Set(Packaging,Concat(BatchMVC,CPackaging & ","));
Set(UniqueID,Concat(BatchMVC,CUniqueID & ","));





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

Super User
Super User

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?



Advocate I
Advocate I

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.

Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.


Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (3,309)