cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RaghavCh
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:

 

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

2 REPLIES 2
AmDev
Memorable Member
Memorable Member

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
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

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,488)