cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
epiej
Level: Powered On

Bulk insert with delimited strings

Say i have the following two comma delimited strings, each split by the split function,

I,have,a,dog

His,name,is,bucky

 

I want to insert these split strings into a datatable such that it looks like

I           His

have    name

a          is

dog     bucky

 

I've tried a forall which successfully inserts the "I have a dog" column, but puts only "His" into every field of column 2.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Bulk insert with delimited strings

@epiej 

Let's say you have two collections from your splits:

ClearCollect(col1, Split("I,have,a,dog", ","));
ClearCollect(col2, Split("His,name,is,bucky",","))

From that we will create a new collection (col3) and put them together:

Clear(ss3);
ForAll(col1, 
Collect(col3,
{column1:Result,
column2:Last(FirstN(col2,CountRows(col3)+1)).Result
}
)
)

You will now have col3 with two columns and the information distributed as you are asking.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Bulk insert with delimited strings

I've done something like this, but using Flow rather than PowerApps.  What you really need is a For Loop where you can reference the individual words using an Index variable.  That's possible with a DoWhile loop in Flow.  I'm not sure how you would do it in PowerApps.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

Re: Bulk insert with delimited strings

@epiej 

Let's say you have two collections from your splits:

ClearCollect(col1, Split("I,have,a,dog", ","));
ClearCollect(col2, Split("His,name,is,bucky",","))

From that we will create a new collection (col3) and put them together:

Clear(ss3);
ForAll(col1, 
Collect(col3,
{column1:Result,
column2:Last(FirstN(col2,CountRows(col3)+1)).Result
}
)
)

You will now have col3 with two columns and the information distributed as you are asking.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,786)