cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
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
Highlighted
Dual Super User II
Dual Super User II

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.
Highlighted
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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,098)