Extract Changes Error - Invalid Sync model type. syncLayers json object is required.

4129
19
11-04-2020 10:49 AM
AidanDonnelly
New Contributor II

Hello,

I'm receiving a strange error when I try to run extractChanges on some of my Hosted Feature Services.  I'm pretty new to using the REST API but had everything working yesterday via Integromat HTTP requests and JSON. 

Sync is turned off on this service as well as the others that are experiencing the issue, but change tracking is turned on.

Thanks for any help.

 Error received from Extract Changes

19 Replies
JulieK
by
Occasional Contributor

yes that's possibility. I don't fully understand what's happening behind the scene I guess. 

[servergen] is part of the changeurl so when you are sending POST changeUrl, how are you extracting servergen array in the query?  am I making sense at all?

0 Kudos
PhilLarkin1
Occasional Contributor III

I use two formulas to pull it from the WebHook payload

Strip_Query_Params JSON (from the payload)
last(split(body('Edit_Payload_Metadata_JSON')?['changesUrl'],'?'))
 
Variable holding serverGens ids:
last(split(first(split(outputs('Strip_Query_Params'),'&')),'='))
 
JulieK
by
Occasional Contributor

Hey Phil,

Thanks for your time, some progress here. When I manually plugged in serverGens in query, it returned the resultsUrl without an error. having said that when I plugged in your formula to extract serverGens, I get 'expression is invalid.

I see you have two formulae and in the second one you are accessing the value of Strip_Query_Params. Do I put both formulae in fx expressions? 

my changesUrl looks like this- 

https://*****.arcgis.com/********/arcgis/rest/services/Equipment_testwebhooks/FeatureServer/extractC...

 

If I put just one formula then it says  "'The template validation failed: 'The template action 'Sendchangesurl' at line '1' and column '2918' is not valid: "The template function 'body' is not expected at this location.".'.'."

 

last(split(first(split(outputs(body('Parse_JSON')?['changesUrl']),'&')),'='))

 

It looks like it is looking for a variable with changesurl. Thanks to you, I am pretty close but not there yet 🙂 Please let me know your thoughts.

0 Kudos
PhilLarkin1
Occasional Contributor III

 

I recommend reviewing some documentation on Parse JSON. If it doesn't make sense or you get stuck create a new Question on this forum. 

https://techcommunity.microsoft.com/t5/microsoft-365-pnp-blog/how-to-use-parse-json-action-in-power-...

0 Kudos
JulieK
by
Occasional Contributor

Hey Phil,

yes I figured it. I created two compose to extract the values and that seems to have done it..phew. Yes, thanks for sharing the documentation, I'll look into it for a better understanding.

0 Kudos
JulieK
by
Occasional Contributor

Hey Phil,

Sorry to bother you again. Now that I have the .json file in the result url, I am trying to send a GET on HTTP connector. Is that the correct process?  I get a redirect error saying object is moved to argisazureprod.blob 😞

any thought Phil ??

 

0 Kudos
PhilLarkin1
Occasional Contributor III

As I mentioned before, it would be best to create a new question. There are some resources on this forum to answer this question. Here is a question I posted awhile ago. It is the same as yours! 

Solved: HTTP Redirect when calling changeFiles JSON with P... - Esri Community

The redirect is expected. Set up a condition that is trigged on the failure of your POST to changeFiles. The POST is expected to fail because Power Automate classifies the 302 code as a failed state. Weird, but that is the way it is.

 

PhilLarkin1_0-1627586501314.png

 

JulieK
by
Occasional Contributor

oh my, I see you had the same issue. Now that you say it, I think I have seen this thread out of millions of threads I visited. Wonder why this is going so complicated. Sorry I keep pinging you but you are the only one who has this actually working 🙂 Thanks so much Phil...appreciate it!

I wish ESRI would have a blog on this for Power Automate too...much needed.

0 Kudos
JulieK
by
Occasional Contributor

Hey Phil,

Somehow I am unable to access the .json file. I have extracted the arcgisazure url, but I cannot download it or upload it to my sharepoint. It says no public access to the folder. What process did you follow to get the feature attributes? I'll go ahead create a new question for this 🙂 Grateful and appreciate your time Phil !!

julian_svcs
Occasional Contributor

I was also getting this. Turns out my layerServerGens string was incorrect. Make sure you only take the value for layerServerGens in the service's changeTrackingInfo. It should look like this:

[
  {
    "id" : 0, 
    "minServerGen" : 1362600, 
    "serverGen" : 1362600
  }, 
  {
    "id" : 1, 
    "minServerGen" : 1362600, 
    "serverGen" : 1362600
  }, 
  {
    "id" : 2, 
    "minServerGen" : 1362600, 
    "serverGen" : 1362600
  }
]