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 / Store multiple control...
Power Apps
Unanswered

Store multiple control values in a single Datacard

(0) ShareShare
ReportReport
Posted on by 86

Hello,

 

I am building an app to create timesheet entries using forms.I am using Common data service to store the data. I wanted to use multiple datepickers in a single data card to store values by row wise per each date. Would that be possible?

 

For below example, Date is DataCard1 and Billable hours is DataCard2 in a single form. (considered as one row in CDS database)

Datacard.png

 

 

 

 

 

 

 

 

So, I have created 3 DatePickers in DataCard1 and 3 TextPickers in Datacard2. However, is it possible to store data by Date wise in database?

I am not sure whether we can use multiple controls in one datacard, if so how? Please someone help here?

 

Regards,

 

Naga

 

 

Regards,

Naga

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi Nagaviswanath,

     

    It seems that it is not possible to use multiple Date picker controls in a single data card to store values and write back to data source.
    I would suggest you don’t use a Form control. Please consider to use Patch function to write data back to the data source.

     

    According to your description, I created a connection from PowerApps to CDS.
    >On a blank screen, add three Datepicker controls, say Datepicker5, Datepicker6, Datepicker7.
    >Then add two Text input controls, say Textinput5, Textinput6.
    >Add a Button control, name it as “Save”, and set its OnSelect property as:
    Patch(Entity1,Defaults(Entity1),{Date1: DatePicker5.SelectedDate,Date2: DatePicker6.SelectedDate,Date3: DatePicker7.SelectedDate,Hours1:Value(TextInput5.Text),Hours2:Value(TextInput6.Text)})
    Then when I click the button the Date and Hours will be saved to Entity1.

    1.png

     

    Please try to use Patch function to save data to the data source but not using a Form. Hope my steps could be a reference for you.
    About Patch function, please check this documentation for a reference:
    https://powerapps.microsoft.com/en-us/tutorials/function-patch/

     

    Please try if this works for you, and feel free reply if you need more help.

     

    Best regards,
    Mabel Mao

  • Nagaviswanath Profile Picture
    86 on at

    Hello Mabel,

     

    Thanks for your inputs, done few modifications and have started using Patch funtion for create/updation of the rows in the CDS. However, i am not able to update the multiple rows of data by clicking on 'SAVE' button. Please see below:PatchFunction_Error.png

     

     

     

     

     

     

     

     

     

     

     

     

     

    I am using following function for SAVE button; OnSelect = Patch(TimeSheet_Week1,Defaults(TimeSheet_Week1),{Day: Value(TextBox8.Text),Worked: Value(TextInput1.Text),Vacation: Value(TextInput2.Text),Sick:Value(TextInput3.Text),Overtime: Value(TextInput4.Text),Client: Value(TextInput5.Text),Location: Value(TextInput6.Text)},{Day: Value(TextBox10.Text),Worked:Value (TextInput7.Text),Vacation: Value(TextInput8.Text), Sick:Value(TextInput9.Text), Overtime:Value(TextInput10:Text), Client:Value(TextInput11.Text), Location:Value(TextInput12.Text)})

     

    Please can you help on this?

     

    Regards,

    Naga

  • Nagaviswanath Profile Picture
    86 on at

    Hello,

     

    I don't want to update the existing records in the database, but multiple rows needs to be added to the database once i click on Save button. Please help on this.

     

     

    Regards,

    Naga

  • Tom_Slosse Profile Picture
    1,430 on at

    Hey @Nagaviswanath

     

     

    You can just use the Patch function like this:  Patch(TimeSheet_Week1,Defaults(TimeSheet_Week1),{Day: TextBox8.Text,...})

    You don't need the Value() function for this operation.

     

    Try to save it and then look in the OnSelect of the Save button to see if PowerApps doesn't give an error on the Patch function.

     

    What entity are you using from the CDS?

    I'll try and recreate your situation and let you know what my outcome is

     

    Kind regards

     

     

    Tom

  • Nagaviswanath Profile Picture
    86 on at

    Hello Tom,

     

    Yes i am using CDS as my database and i don't think we can use Datacards for my requirement. So i am using text input to store values.

     

    Regards,

    Naga

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard