cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

How to save View Mode Datacard Text into CRM from Powerapps

I am Saving Data into CRM from Powerapps.

In Screen1: Gallery1 I am Showing list of Account Names from Account Entity.

Gallery1 Items: Sort(Search(Accounts, TextInput1.Text, "name"), 'Account Name', Ascending)

In Screen2: Gallery2 I am Showing list of Contact names from Contact Entity based on Gallery1.Selected.Account

Gallery2 Items: Filter(Contacts, 'Company Name' in Gallery1.Selected.Account)

In Screen3: I am having an EditForm1 and this form is connected to Feedback Entity. EditForm1 Filelds Contains(Account, Contact, Email,Propose, Feedback By, Feedback Date).

In Account DatacardValue: Gallery1.Selected.'Account Name'

In Contact DatacardValue: Gallery2.Selected.'Contact Name'

In Email Datacardvalue: Gallery2.Selected.Email

When Save Button is Clicked, all the Fields are Saving into CRM Except Account and Contact Datacards. Because those two Datacards are in View Mode. I changed the Display Mode of Account and Contact Datacards to "Edit". Still the value in those two Datacards is not saving in CRM.

tempsnip.png

Can anyone help me how to Save View Mode Text into CRM through Powerapps.

7 REPLIES 7
Highlighted
Community Support
Community Support

Hi @Chandu ,

Could you please share a bit more about the "Account" field and "Contact" field within your Feedback Entity? Are they both Text type column?

Could you please show more details about the 'Contact Name' field in your Contacts Entity?  Is it a custom field?

 

Based on the formula you provided within the Items property of the Gallery2, I think there is something wrong with it. I have made  a test on my side, please consider take a try with the following workaround:

 

1. If the "Account" field and "Contact" field are both Text type column in your  Feedback Entity:

Set the Items property of the Gallery2 to following:

Filter(Contacts, AsType('Company Name', [@Accounts]).Account = Gallery1.Selected.Account)

 

Within your Editform1, set the Default property of the "Account" Text box to following:

Gallery1.Selected.'Account Name'

set the Update property of the Account field data card to following:

AccountTextBox.Text

 

set the Default property of the "Contact" Text box to following:

Gallery2.Selected.'Full Name'

set the Update property of the Contact field data card to following:

ContactTextBox.Text

Note: Actually, the 'Company Name' field is a Polymorphic lookup field in your Contact Entity, which would refer to a record from either the Accounts entity. Please check the following article for more details:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-references#show-the-fields...

 

2. If the "Account" field and "Contact" field are LookUp type column in your Feedback Entity (Account field reference values from Accounts Entity, Contact field reference values from Contacts Entity) :

Set the Items property of the Gallery2 to following:

 

Filter(Contacts, AsType('Company Name', [@Accounts]).Account = Gallery1.Selected.Account)

 

 

Within your Editform1, set the DefaultSelectedItems property of the "Account" ComboBox to following:

 

If(
    EditForm1.Mode = FormMode.New,
    LookUp(Accounts, 'Account Name'= Gallery1.Selected.'Account Name'),
    Parent.Default
)

 

set the Update property of the Account field data card to following:

 

LookUp(Contacts, 'Account Name'= Gallery1.Selected.'Account Name')

 

 

set the DefaultSelectedItems property of the "Contact" ComboBox to following:

 

If(
    EditForm1.Mode = FormMode.New,
    LookUp(Contacts, 'Full Name'= Gallery1.Selected.'Full Name'),
    Parent.Default
)

 

set the Update property of the Contact field data card to following:

 

LookUp(Contacts, 'Full Name'= Gallery1.Selected.'Full Name')

 

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.
Highlighted

Both Account and Contact Fields Datatype is lookup in Feedback Entity. I tried the below formula in Gallery2 Items, I am getting error.

Set the Items property of the Gallery2 to following:

 

Filter(Contacts, AsType('Company Name', [@Accounts]).Account = Gallery1.Selected.Account)

 

Highlighted

Hi @Chandu ,

Could you please share more details about the error message with the Filter function in your app?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Have you turned on the "Improve data source experience and Common Data Services views" option within the Advanced settings of your App settings of your app?

 

Please make sure you have turned on the "Improve data source experience and Common Data Services views" option within the Advanced settings of your App settings of your app.

 

In addition, the above Filter formula I provided may cause a Delegation warning issue, it is not an error. It just means that you could not delegate the data process from your app to your CDS Entity, instead, you could only process data locally within your app.

More details about the Delegation in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

More details about the AsType function in PowerApps, please check the following article:

AsType function

 

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.
Highlighted

"Improve data source experience and Common Data Services views" option within the Advanced settings is Initially Turned on.

When I load Account and Contact Field in Editform1, I am getting Error in the Default Property of both the Fields. When I select ThisItem.'Contact(tmeic_Contact)' and ThisItem.'Customer Name (tmeic_CustomerName)' respectively. The error and warning symbol will be gone.

Account.PNGContact.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After that, In Gallery2 Items Property I am having the formula you wrote. I am getting Error like this.

Gallery After.PNG

 

 

 

 

 

 

 

 

 

 

Can you help me, How to Solve this Error?

Highlighted

Hi @Chandu ,

Currently, I could not reproduce your issue on my side. Based on the issue that you mentioned, I think this issue may be related to CDS Entity connection in your app.

 

Please consider remove the Feedback Entity connection, Contacts Entity connection, Accounts Entity connection from your app, then re-create a new connection to these Entities again from your app. Also please consider add a new Edit form in your app, then connect it to your Feedback Entity, check if the issue is fixed.

 

In addition, please also check if you have made some changes to the Contact field and Account field in your Feedback Entity, if yes, please must refresh the Feedback Entity data source within your app manually.

Note: Please make sure that these data card fields in your Edit form (connects to Feedback Entity) are actually existed in your Feedback Entity.

 

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.
Highlighted

I refreshed the Entity. Removed Entities and added again. Still the error is same.

Highlighted

Hi @Chandu ,

I have made a response to the similar thread you posted in this community, please check my response within the following thread:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Filter-Contacts-Entity-based-on-Selected-Acc...

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been 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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,610)