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 / Having multiple lines ...
Power Apps
Answered

Having multiple lines in a Data Card create new record on new line in SharePoint List

(0) ShareShare
ReportReport
Posted on by 216

Hi everyone!  I am hoping you can please help me.  As you can tell from all of my recent posts, I am a new person to PowerApps.  I am making progress but am hoping you can help me.  I have an app with multiple forms.  Within each form I have a data card that contains multiple project expiration dates.  How can I get an entry for each of these dates to copy all the information from the form (thats entered once) so new entries are on each line on a SharePoint list?  For example, I enter the project type, project category, project positions and bill rate all one time.  The project date will have multiple entries so I need all the information (project type, category, positions and bill rate) entered one time to appear on a separate line with the various project dates.  I hope this makes sense, and any help would be greatly appreciated.

 

Brian

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Brian_S , If I am reading this right. You have a Form connected to a SharePoint List. This form contains several Data Cards.

     

    You unlocked and customized one of the Data Cards by adding in multiple date fields.

     

    On the Form, users enter project information (Title, Type, Category, Positions, Bill Rate) and save the data back to the SharePoint List.

     

    However, you want to duplicate the saved record in the SharePoint list per the number dates in the Data Card. You want to end up with something like below:

     

    Amik_0-1683400700485.png

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

     

  • Brian_S Profile Picture
    216 on at

    Hi Amit. Exactly as you stated but

    how can I do it? 😊. I have been trying different options since yesterday. Any help would be truly appreciated.

  • Brian_S Profile Picture
    216 on at

    My deepest apologies I noticed a typo Amik.  

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @Brian_S ,

     

    Apply the below to the OnSelect property of a Button control, you would need to use a Patch function to achieve this.

     

    I would caveat that given you're new to Power Apps, I would strongly recommend doing some reading/watching some tutorials on the Patch and For All functions, as well as on Collections, just to understand what is going on here (anything from Shane Young and Reza Dorrani on YouTube if you have not already).

     

     

     

    ClearCollect(//get dates into a collection
     ColDates,
     {Dates: Your_DatePicker1.SelectedDate},
     {Dates: Your_DatePicker2.SelectedDate},
     {Dates: Your_DatePicker3.SelectedDate}
    );
    Patch(
     YOUR_DATA,
     ForAll( //for all dates in the collection, do:
     ColDates,
     {
     projecttype: DataCardValue1.Text,
     category: DataCardValue2.Text,
     positions: DataCardValue3.Text,
     billrate: Value(DataCardValue4.Text), //assumes your bill rate column is a Number data type
     projectdate: ColDates[@Dates]
     }
     )
    );

     

     

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

  • Brian_S Profile Picture
    216 on at

    Hi Amik!  Thank you so much!  I will work on this tomorrow or next day and let you know how it goes. I will also be watching the videos. Thank you again. Brian

  • Brian_S Profile Picture
    216 on at

    Hi Amik!  I have been working on the formula and I am getting like 20 errors on it.  I have copied the formula below and I am thinking it may have something to do with the dates.  I tried changing the dates to data but that didn't work either.  Another error I am getting is "Unexpected characters" and "Expected Colon".  I also began watching those videos and they are really interesting - thanks for sending me that way.  I tried to change the formula based on the videos but no luck :(.  Thanks again for all your help I really appreciate it.  Brian

     

    ClearCollect(//get dates into a collection

        ColDates,

        {PoP: txtPoP1.text},

        {PoP: txtPoP2.text},

        {PoP: txtPoP3.text},

        {PoP: txtPoP4.text},

    );

    Patch(

        'New Unanet Form List Test',

        ForAll( //for all dates in the collection, do:

            ColDates,

            {

                Title: drpPriceMode.Selected.Value,

                Call Order: drpCallOrder.Selected.Value,

                Task: txtTask.Text,

                Position: txtPosition.Text,

                Call Order Rate: Value(txtRate.Text), //assumes your bill rate column is a Number data type

                PoP: ColDates[@Dates]

            }

        )

    );

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Brian_S  - I cannot speak for the other errors yet, but first and foremost you’re trying to Patch Text values into what I assume are Date columns in SharePoint.

     

    For obvious reasons I would not recommend allowing users to enter Dates from a Text field. Replace the Text Input Boxes with Date Picker controls.

     

    If you really must use Text Input Boxes to capture Dates, you need to wrap each field with the DateValue function. E.g.

     

     

     ColDates,
     {PoP: DateValue(txtPoP1.tex)},
     {PoP: DateValue(txtPoP2.text)},
     {PoP: DateValue(txtPoP3.text)},
     {PoP: DateValue(txtPoP4.text)},

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution

    If you like my response, please give it a Thumbs Up.

  • Brian_S Profile Picture
    216 on at

    Amik your awesome!  I got it to work (user error on my part).  Thank you so much.  Have a great weekend.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard