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

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,821)