cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Power-Tim
Frequent Visitor

Updating Data Source from custom DataCard

I want to use a rich text control in a form to update a Sharepoint list.     So I have created custom DataCard and added the rich text field to it.   Works great except the submitform() command does not update the list with the data from the rich text control.   I have set the "data field" property on the data card to the correct list field, but does not seem to update the field.    What is the suggested method for updating a list from a custom datacard using a custom control?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Power-Tim ,

Could you please share a bit more about your scenario?

Do you add a Custom data card in your Edit form? Which type column do you use to store the Rich Text value in your SP List?

Further, do you want to submit the Rich Text value from the custom data card in your Edit form back to your SP List?

 

Currently, within PowerApps, we could not bind a Custom data card to a field in a data source (e.g. a SP List), and the SubmitForm function could not submit custom data card value.

 

Based on the needs that you mentioned, I think it is not necessary to add additional custom data card in your Edit form to collect data. Instead, you could enable the corresponding List field in your Edit form, then the corresponding data card would be generated within your Edit form.

After that, you could consider change the Original Text Input box under the List field data card into a Rich Text control as below:

Convert original Text box to Rich Text BoxConvert original Text box to Rich Text Box

 

2.JPG

then you could type your text within the Rich Text control, then press Submit button, the Rich text value would be saved to your SP List using SubitForm function.

 

If you just want to add a custom data card in your Edit form, and want to save the Rich Text value within this custom data card back to your SP list, I think the Patch function could achieve your needs. Please take a try with the following workaround:

Set the OnSelect property of the "Submit" button to following:

Set(EnteredRichText, RichTextEditor1.HtmlText);
SubmitForm(EditForm1)

Set the OnSuccess property of the Edit form to following:

Patch(
      'YourSPList',
      EditForm1.LastSubmit,
      {
          ListTextField: EnteredRichText       /* <-- Update the Rich Text value back to Text field in your SP List */
      }
)

or

Patch(
      'YourSPList',
      LookUp('YourSPList', ID = EditForm1.LastSubmit.ID),
      {
          ListTextField: EnteredRichText
      }
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @Power-Tim ,

Could you please share a bit more about your scenario?

Do you add a Custom data card in your Edit form? Which type column do you use to store the Rich Text value in your SP List?

Further, do you want to submit the Rich Text value from the custom data card in your Edit form back to your SP List?

 

Currently, within PowerApps, we could not bind a Custom data card to a field in a data source (e.g. a SP List), and the SubmitForm function could not submit custom data card value.

 

Based on the needs that you mentioned, I think it is not necessary to add additional custom data card in your Edit form to collect data. Instead, you could enable the corresponding List field in your Edit form, then the corresponding data card would be generated within your Edit form.

After that, you could consider change the Original Text Input box under the List field data card into a Rich Text control as below:

Convert original Text box to Rich Text BoxConvert original Text box to Rich Text Box

 

2.JPG

then you could type your text within the Rich Text control, then press Submit button, the Rich text value would be saved to your SP List using SubitForm function.

 

If you just want to add a custom data card in your Edit form, and want to save the Rich Text value within this custom data card back to your SP list, I think the Patch function could achieve your needs. Please take a try with the following workaround:

Set the OnSelect property of the "Submit" button to following:

Set(EnteredRichText, RichTextEditor1.HtmlText);
SubmitForm(EditForm1)

Set the OnSuccess property of the Edit form to following:

Patch(
      'YourSPList',
      EditForm1.LastSubmit,
      {
          ListTextField: EnteredRichText       /* <-- Update the Rich Text value back to Text field in your SP List */
      }
)

or

Patch(
      'YourSPList',
      LookUp('YourSPList', ID = EditForm1.LastSubmit.ID),
      {
          ListTextField: EnteredRichText
      }
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Power-Tim
Frequent Visitor

You first option worked fine.   I did not know I could edit the field type.   Thanks

Hi @Power-Tim ,

Have you solved your problem?

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread as Solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,481)