cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
epiej
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
RandyHayes
Super User III
Super User III

@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.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

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.
RandyHayes
Super User III
Super User III

@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.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (67,033)