So I have a PowerApp on Sharepoint that works great but I am wondering if I can get it to work even better!
Right now, we are manually entering each individuals First Name, Last Name, Phone, Security ID. We receive this information via email on a Excel Spreasheet. Sometimes there can be as many as several hundred individuals we have to manually enter, which is time consuming.
I am wondering if there is a way for Power Apps to allow me to copy multiple individuals from the excel spreadsheet and paste into the Power App? Or could Flow help with this?
I would appreciate any ideas and or help on this.
Solved! Go to Solution.
I'm not entirely sure what that image shows. That appears to be one of the screens in the app. What I am looking for is what is the formula that you use to collect items into Collection 2?
Does it have initial data when displayed to the user, or is it empty and the goal is to fill it?
Very good!
Okay, so I would keep the process of copy and paste separate from adding, removing or altering. In that scenario, there is no particular need for a Collection. Your Gallery will already be your collection.
Now, for your solution.
Add a Textinput Control to your app and make it multiline. Let's call it txtPastedText
Place a Gallery in your app and add 4 TextInputControls to the Gallery Template - let's call them txtFirst, txtLast, txtPhone, txtSecurity
Add a Toggle control to your Gallery template - let's call it tglRehire
Now, set the Items property of your Gallery to the following formula:
ForAll(
Filter(Split(txtPastedText.Text, Char(10)), !IsBlank(Result)),
With({pasteData:Filter(Split(Result, Char(9)) As line, !IsBlank(Trim(line.Result)))},
{firstName: If(CountRows(pasteData)>=1, Last(FirstN(pasteData, 1)).Result, ""),
lastName: If(CountRows(pasteData)>=2, Last(FirstN(pasteData, 2)).Result, ""),
phone: If(CountRows(pasteData)>=3, Last(FirstN(pasteData, 3)).Result, ""),
securityID: If(CountRows(pasteData)>=4, Last(FirstN(pasteData, 4)).Result, ""),
rehire: If(CountRows(pasteData)>=5, Last(FirstN(pasteData, 5)).Result, "New")
}
)
)
Now, set the Default properties of the above gallery controls to the following:
txtFirst - ThisItem.firstName
txtLast - ThisItem.lastName
txtPhone - ThisItem.phone
txtSecurity - ThisItem.securityID
tglRehire - ThisItem.rehire = "Rehire"
Run your app and paste data into the textinput control. Your Gallery will then have the information broken out.
Note: in the shots below, I used this for data:
Here it is in action:
This is exactly what I needed! You are amazing and I appreciate you! One question...I cannot get the toggle to work. I titled it tglRehire, I changed Default to ThisItem.rehire= "Rehire" but it doesn't like that. What am I doing wrong?
@Tbruns
Is that toggle in your Gallery? Tell me more...is the rehire still in the formula I provided or have you modified any?
If you put a Label in the Gallery and set the text to ThisItem.rehire, what do you see?
@RandyHayes One more question...How do I get the information in my Gallery into my Sharepoint list? Before (when I was using Collections) I used a "Submit" button.
I'm not entirely sure how you used the submit button before. But, in general, you would just ForAll the Gallery.
Ex.
ForAll(yourGallery.AllItems, Patch(yourList, Defaults(yourList), {column: control.Text, etc.})
That's a very general formula, so if you need more specifics, let me know more about what you had before and I can help build that up.
This is what I had before when I was using Collections.
ForAll(
Collection,
Patch(
'Sharepoint List Name',
Defaults('Sharepoint List Name'),
{
'First Name': Collection2[@FirstName],
'Last Name': Collection2[@LastName],
'Security ID': Collection2[@SecurityID],
}
)
);
Navigate(Screen4)
User | Count |
---|---|
252 | |
106 | |
96 | |
51 | |
39 |