cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

Incompatible type - offline caching

Hi all,

 

I am in the middle of building a service call app with Power Apps where the data source = SharePoint Online (lists).

When on a service call for machine troubleshooting, an employee must take note of the activities performed.

 

The app is built this way https://powerapps.microsoft.com/en-us/blog/implementing-offline-capability-in-your-app/ to enable offline capabilities. Service to some machines takes place in basements where there is hardly/no internet connectivity.

 

I had setup my Form (associated with the 'Service calls' list) which allows the employee to register a new service call. The form contains a combobox which allows the employee to select the machine related to the service call. It was a single value combobox associated to a lookup column (to the Title column of the list 'InstalledBase' where the machines are stored). It works fine, even offline.

During testing, the key user mentioned that a service call can be associated to multiple machines.

 

For this reason, I removed the existing 'Machine' datacard from the form, went to SharePoint, opened the column settings of the 'Apparaat' / Machine (lookup) column which points to the InstalledBase list. From here I disabled the 'enforce relationship' and enabled 'Allow multiple values'.

Next, I went back to my form in Power Apps and added the field 'Apparaat' to the form again. It automatically detected that multiple values can be saved.

 

I, again, inserted the following formula in the Items property of the combobox:

 

SortByColumns(Filter(ApparatenCollection,Value in Filter(InstalledBaseCollection,Klant = DataCardValue8.Selected.Value).Product),"Value",Ascending)

 

Which filters the Machines from the InstalledBase collection by matching the selected Customer/Klant (DataCardValue8).

 

This all works fine. Even saving the values work perfectly.

But I do notice an error popping up in the Timer control 'OnTimerEnd' property (row 2):

 

If(Connection.Connected && CountRows(ServicebezoekenToBeAdded) >0,
                     Collect(Servicebezoeken,ServicebezoekenToBeAdded);

 

 Error.png

 

Configuring the Timer control was explained in Part 2 of this article here: https://powerapps.microsoft.com/en-us/blog/implementing-offline-capability-in-your-app/

 

I can imagine that this error occurs, because I had changed the settings of the SharePoint lookup column 'Apparaat' (Machine) to 'Allow multiple values'. But I have no clue how to resolve this issue.

 

Could it be that the Collection is still retaining its original 'Record' type values and that it should be changed to Table type values?Would I need to create a new collection?

 

Anyway, could someone anyone help me out with this one?

 

All help is appreciated. Thanks a lot!

Joost

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Got it sorted out thanks to a MS support engineer. 

The OnSelect property of the save button on the 'new service call' form contains a check to determine if the device is connected. If not, it should save the item to the Collection.

I had to change:

 

Collect(ServicebezoekenToBeAdded,{Apparaat:DataCardValue13.Selected}

 

to:

 

Collect(ServicebezoekenToBeAdded,{Apparaat:DataCardValue13.SelectedItems}

 

After all, it could not be an easier thing to solve... -.-

View solution in original post

8 REPLIES 8
Highlighted
Super User II
Super User II

@jvdlinden 

I think this error is because the first time the collection was built, with single choice, it retains an imprint of that column type, even though collections are built as/when required.

 

I've had similar issues before and what I do is to add a letter or number to the end of my collection name, save the app, wait a bit, reopen the app and change the collection name back again. This seems to resolve it, most of the time.

 

Generally, now, I won't change any column types or specs like you have done here, instead I just create a whole new column. It's a little annoying but saves a lot of headaches.

Highlighted

Hi @Eelman thanks for your swift reply.

I had the same thought.

 

I did exactly what you suggested, change all references to the collection from ServicebezoekenToBeAdded to ServicebezoekenToBeAdded2 so it is easy to distinguish, and published the change, closed the app, opened the app again and verified the original collection had been removed (it did).

 

After I changed back the code, unfortunately the error message still shows 😞

 

Highlighted

@jvdlinden 

I will revisit an app of mine in the morning (evening time here in Australia) to see if I can find any other ideas for you. 

 

You could try changing the collection name and leaving it a few hours so it definitely changes in the Cloud then change it back? You may have to totally rename your collection throughout your app though to fix this, which could be quite a job?

Highlighted

Hi @Eelman ,

 

Yes correct! Luckily the collection is not referenced too many times.

In the meantime I will perform another rename and wait a few hours as you suggested.

Highlighted

As I have changed the Collection reference, I can immediately see the change.

I will leave this for 24 hours or so and change back later.

Collections.png

Highlighted

@jvdlinden 

I had a look at my app which had a troublesome collection and it's no longer doing. I haven't touched it in awhile so cannot recall the exact issue I was having but I think it was something to do with changing at 'Single-line of Text' column to a 'Multi line of Text'.

 

How did you go, have any luck?

Highlighted

Unfortunately no luck so far 😞

Highlighted

Got it sorted out thanks to a MS support engineer. 

The OnSelect property of the save button on the 'new service call' form contains a check to determine if the device is connected. If not, it should save the item to the Collection.

I had to change:

 

Collect(ServicebezoekenToBeAdded,{Apparaat:DataCardValue13.Selected}

 

to:

 

Collect(ServicebezoekenToBeAdded,{Apparaat:DataCardValue13.SelectedItems}

 

After all, it could not be an easier thing to solve... -.-

View solution in original post

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 (7,898)