cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ruprect
Frequent Visitor

Schema Differences between environments when used in Canvas App

I have an issue with a Canvas App that is on DEV, TEST and PROD, and their connection to Dataverse.

 

On PROD I can get the current Contact by the command ThisItem.'Contact (contactid') but on DEV and TEST I get it by the command ThisItem.Contact this difference makes it impossible to copy the Canvas app between environments.

 

On Prod:

Ruprect_0-1649144815842.png

 

On Dev and Test:

Ruprect_1-1649145052610.png

 

Is there a way to synchronize the schema between environments?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Ruprect ,

 

As I said, you will need to check the unique identifier columns of the Contact tables of all environments, make sure they are with the same Name.

vjefferni_1-1649644778954.png

 

Please try and modify the formulas in both environments, use Name value instead:

Set(CurrentCustomer, ThisItem.contactid);
Filter(Contacts, contactid = GUID(CurrentCustomer))

 

You may not be able to find contactid from the suggestions dropdown of the formula bar, but it accepts manual entry.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

5 REPLIES 5
v-jefferni
Community Support
Community Support

Hi @Ruprect ,

 

Could you please share more details of your scenario? Which table of Dataverse includes the Contact column? What type is this column? 

 

The issue is in PROD environment the App could not recognize the column by name, which will cause errors. I cannot find a way to totally bypass the issue from the App end. If possible, you will need to edit the Contact table in the TEST and DEV environments or in the PROD environment.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-jefferni,

 

I'll try to explain what I did in a separate Canvas App (apart from the app where I noticed the problem).

 

The App I created on both environments. Environments are on same Tenant (a customer of ours).

 

On DEV and TEST environment:

 

The App has two screens:

  • Screen 1
  • Screen 2

 

Screen 1

Contains a Gallery (Gallery1) of Dataverse.Contacts:

Ruprect_2-1649455360365.png

The Datasource of this gallery is Contacts from Dataverse:

Ruprect_3-1649455482131.png

 

The Arrow on each contact has the following OnSelect code:

Select(Parent)

 

And the Parent (Gallery1) has the following OnSelect code:

Set(CurrentCustomer, ThisItem.Contact);
Navigate(Screen2);

 

Screen 2

Contains another Gallery (Gallery2😞

Ruprect_4-1649455565505.png

The datasource of this gallery is a function:

Filter(Contacts, Contact = GUID(CurrentCustomer))

 

And displays the Contact selected on Screen1.

 

On PROD environment:

Everything is the same, apart from the OnSelect of Gallery1, here it is:

Set(CurrentCustomer, ThisItem.'Contact (contactid)');
Navigate(Screen2);

 

DataSource for Gallery1 is the Contacts from Dataverse:

Ruprect_5-1649456453065.png

 

And the same on Screen2, the Items of Gallery2 is:

Filter(Contacts, 'Contact (contactid)' = GUID(CurrentCustomer))

 

But apart from that, the app functions the same:

 

Screen1

Ruprect_6-1649456561253.png

 

Screen2

Ruprect_7-1649456590231.png

 

Comparing the two versions

By using the PASopa app to unpack the .msapp files, and then comparing the two Screen YAML files - The only difference is the above differences:

 

Screen1:

Ruprect_8-1649457352218.png

 

Screen2:

Ruprect_9-1649457372433.png

 

 

Hi @Ruprect ,

 

As I said, you will need to check the unique identifier columns of the Contact tables of all environments, make sure they are with the same Name.

vjefferni_1-1649644778954.png

 

Please try and modify the formulas in both environments, use Name value instead:

Set(CurrentCustomer, ThisItem.contactid);
Filter(Contacts, contactid = GUID(CurrentCustomer))

 

You may not be able to find contactid from the suggestions dropdown of the formula bar, but it accepts manual entry.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

v-jefferni
Community Support
Community Support

Hi @Ruprect ,

 

Have you solved the issue?

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-jefferni 

 

Yes, the problem was that on the PROD environment the Dynamics Marketing was installed, and due to licensing and some connection to Azure, it was not installed on DEV and TEST - Therefore the offending field was not found on DEV and TEST.

 

Here you can see the differences, and the offending field on PROD

 

Ruprect_0-1650611920589.png

 

But as you suggested by using the schemaname of  .contactid instead of .'Contact (contact)' on PROD and .Contact on DEV and TEST, the problem was solved.

 

Thank you for your help, your solution has been marked as accepted.

 

Regards,

Michael

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,942)