web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to duplicate infor...
Power Apps
Answered

How to duplicate information in Sharepoint for each name inserted in a PowerApps form

(0) ShareShare
ReportReport
Posted on by 125

Hello everyone 🙂

I created an app that track activities duration for a x number of people. The user of the app will need to insert in a sharepoint form in the app the names of the indidivual:

Fedegallo_0-1681206860116.png


individual1
individual2
individual3
and so on

distributed vertically as above and not separeted by a coma.

The issue is that if I want to analyze the data collected I can't do it for each individual because the individuals name are registered in the sharepoint in one cell (all together). What I would like to do is that every time the user press the button start to collect the start time of the activity and the button end the app would create one entry for each individual inserted in the form. 

From what I understood the ForAll function could help me achieve that but I cant make it work.
The formula in my Start Button is the following ( similar to the end one):

Fedegallo_1-1681206908810.pngSet(varNewItem, Patch('Coaching Tracker', Defaults('Coaching Tracker'), {'Created by': User().Email, 'Analyst''s EID': DataCardValue12.Text, 'Activity Performed': DataCardValue13.Selected, 'Code Used': DataCardValue14.Selected, 'Start Time': Now(), 'Session Active': true}));

Anyone can help me to achive that? thanks a lot

Categories:
  • mmollet Profile Picture
    3,187 on at

    So you are storing mulitple names in one cell to use it as if it were multiple entries? So John, Bob, Mike, and Ron are all doing the same task so you have an entry like this:

    Name: John Bob Mike Ron

    Task: Coding

    Active: true

    StartTime: Now()

     

    etc... instead of an entry for each person individually 

     

    Is this what you are doing?

  • Ygor Profile Picture
    44 on at

    Hi @Fedegallo

     

    Maybe this steps can help you.
    1- Create another column in SP, like "End time" (If you don't have).

    2- Start button's OnSelect you can remove that part (Defaults('Coaching Tracker')) and set a updateContext({Hour: now()}). Read more of defaults function in this link 

    3- End button's OnSelect that's where the "magic" is,  you can use something like this:
    UpdateIf(

        'Coaching Tracker',

         Start Time = Hour,

        {

         "End Time": Now()

        } 

    );

    Reset(DataCardValue12.Text);

    Reset(DataCardValue13.Selected);

    Reset(DataCardValue14.Selected);

    UpdateContext({Hour: Blank()})

     

    This steps should created a new record each time you click start's button and update the same row when you click end's button.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Fedegallo,

     

    As I understood it, the names are separated by a new line / enter. In this case, a ForAll could help by splitting the 'EID' text by the new line character. Additionally, instead of saving the created record to a variable - we will save the new records to a collection. However, in this solution the presence of some sort of separator is very important.

     

    ForAll(
     //Returns an array of names split by the new line character
     Split(
     DataCardValue12.Text,
     //Should the names not be split by a new line, you can change the separator below e.g. ", "
     Char(10)
     ) As Main,
     Collect(
     //All records are saved to a collection
     colNewItems,
     Patch(
     'Coaching Tracker', 
     Defaults('Coaching Tracker'), 
     {
     'Created by': User().Email, 
     'Analyst''s EID': Main.Value, //Only saves the current loop's EID
     'Activity Performed': DataCardValue13.Selected, 
     'Code Used': DataCardValue14.Selected, 
     'Start Time': Now(), 
     'Session Active': true
     }
     )
     )
    )

     

    Updating those values would be a ForAll as well, but this time referencing the collection:

    ForAll(
     colNewItems,
     Patch(
     'Coaching Tracker',
     ThisRecord, //Should this fail try LookUp('Coaching Tracker', ThisRecord.ID = ID)
     //{} your updates here
     )
    );
    Clear(colNewItems)

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard