Unable to retrieve feature layers when setting up ArcGIS Connector in Microsoft Power Automate

2156
13
08-06-2022 10:25 AM
KevinMantels
New Contributor II

I am trying to create a new automated cloud flow in Microsoft Power Automate using the ArcGIS for Power Automate connector and its available triggers.  Regardless of which trigger I use, when I attempt to select the feature layer to be tracked I receive the following error message: "Could not retrieve values.  The dynamic invocation request failed with error: Unexpected error occurred when calling the APIHubsRuntime API: ...".  A screenshot of the error message is below.

I have confirmed that the ArcGIS for Power Automate connector has the correct credentials for my ArcGIS Online account and is connected.  I have a premium Power Automate account, so even though ArcGIS is a premium connector I do not believe that would be the issue.  I am using Power Automate in a government environment, and I have noticed that the connectors that are available in my government account are limited compared to those available in commercial accounts, but I am uncertain if that could be causing these issues.  Lastly, for what it's worth, I am able to create flows with the Survey123 connector without any issue.  I realize they are two completely different connectors, but I am still mentioning in case it is relevant.

I am not sure if I am missing some steps or settings.  The Survey123 connector worked out of the box, so I had assumed the ArcGIS connector would as well.  Bottom line is I am out of troubleshooting ideas at this point.  Any assistance would be greatly appreciated.

KevinMantels_0-1659805702267.png

0 Kudos
13 Replies
SeanKMcGinnis
Esri Contributor

Hello @KevinMantels - Since you are in the first step of establishing the webhook, it does not appear you are missing any steps. The thing I am noting is that it is a .NET error with a number of 'Azure' references and not one that is being thrown by the ArcGIS Online Connector for Power Automate. Because you are in GCC may be adding a wrinkle, but it tough to fully tell from the truncated error message.

Could you please submit a support ticket? That way we can get additional people involved to try and figure out the source of the issue.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
SeanKMcGinnis
Esri Contributor

Hi @KevinMantels 

I was talking with one of the product developers trying to figure out what the issue might be and noticed the 504 error. It raised the question, how many layers do you own? 

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
KevinMantels
New Contributor II

@SeanKMcGinnis, great catch!!  The account I was attempting to use with the connector has ~225+ layers.  I tried using a different AGOL account with a minimal number of layers and the connector worked perfectly.  Thank you for noticing and pointing out this issue--I never would have thought of it.

For my future reference, is there a specific maximum number of layers that is permitted before the connector will no longer work correctly and result in this error?  I'm just trying to determine if our organization may need to take steps to ensure that the Power Automate connectors continue to work properly.

0 Kudos
SeanKMcGinnis
Esri Contributor

@KevinMantels - I am glad you did the additional testing to and saw that it worked in an organization with fewer records. Unfortunately, we do not have an estimated number of layers in an organization and then things get weird. We have tested it in organizations with 1000+ layers and it works. My personal organization has over 500 layers and it works. Since you are working with ~225 layers and having an issue, that breaks our assumption that it is a sheer volume/count is a limiting factor.

If you do not mind, there are two things we can do to test and see if we can get them to be successful or throw a more meaningful error.

1. Try to use the 'Get data from feature layer' action to see if that returns the list of feature layers in your organization.

Screen Shot 2022-08-11 at 11.46.55 AM.png

 

2. Instead of picking the feature layer from the dropdown, paste the Item ID into the field and see if that will grab the layer and let you build the rest of the flow

I am adding @PavelJ to this thread and he may be able to help us out further.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
KevinMantels
New Contributor II

@SeanKMcGinnis - just to clarify, both of the AGOL user accounts I tested on are in a single organization.  I'm not sure if it's relevant but I just wanted to mention.  The 225 layer count is for my personal user account, but the organization as a whole has around 450 layers total.  The second user account I tested on has only one layer.

 

Following up on your suggestions:

1. Try to use the 'Get data from feature layer' action to see if that returns the list of feature layers in your organization.

This unfortunately still resulted in an error message that appears to be the same as the one I received previously.  In addition to the below screenshot I am also pasting the entire text of the error message in the hope that it may be useful.

KevinMantels_0-1660235187411.png

Could not retrieve values. The dynamic invocation request failed with error: Unexpected error occurred when calling the ApiHubsRuntime API: 'Microsoft.Azure.ProcessSimple.Data.Entities.Exceptions.ProcessSimpleDataException: The ApiHubsRuntime API call failed with http status code 'GatewayTimeout' and response content '{
"error": {
"code": 504,
"source": "power-apis-usgov001-public.azure-apihub.us",
"clientRequestId": "98e36f30-2783-4a96-acbc-68379e35fe7d",
"message": "The response is not in a JSON format.",
"innerError": "<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body>\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n</body>\r\n</html>\r\n"
}
}'
at Microsoft.Azure.ProcessSimple.Data.DataProviders.AzureResourceManagerDataProvider.<>c__DisplayClass52_0`2.<<CallAzureResourceManager>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.AsyncRetry.<Retry>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.ProcessSimple.Data.DataProviders.AzureResourceManagerDataProvider.<CallAzureResourceManager>d__52`2.MoveNext()'.

 

2. Instead of picking the feature layer from the dropdown, paste the Item ID into the field and see if that will grab the layer and let you build the rest of the flow

This DOES work.  I was able to successfully build and test a flow using this method.  To be specific--it worked with the connector tied to my personal AGOL account with the 225 layers, which makes it a successful workaround for us going forward.  Thanks so much for suggesting this option.

0 Kudos
Esteban_Leguizamo
New Contributor

Any updates on this problem. I am trying to automate some processes and the PowerAutomate does not work even with the templates provided.

JessMiller1
New Contributor II

Has there been any movement with this issue? I'm having the same issue and can't seem to connect to anything! I'm also in the GCC licensing, but not High.  Please help! Error posted below.

JessMiller1_0-1698329886788.png

 

Could not retrieve values. The dynamic invocation request failed with error: Unexpected error occurred when calling the ApiHubsRuntime API: 'System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.ProcessSimple.Data.DataProviders.HttpClientDataProvider.<>c__DisplayClass47_3`2.<<CallService>b__2>d.MoveNext() in C:\__w\1\s\src\processsimple\Roles\ProcessSimple.Data.Shared\DataProviders\Services\HttpClientDataProvider.cs:line 580 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WindowsAzure.ResourceStack.Common.EventSources.IHttpEventSourceExtensions.<TraceHttpOutgoingRequest>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.ProcessSimple.Data.DataProviders.HttpClientDataProvider.<>c__DisplayClass47_1`2.<<CallService>b__0>d.MoveNext() in C:\__w\1\s\src\processsimple\Roles\ProcessSimple.Data.Shared\DataProviders\Services\HttpClientDataProvider.cs:line 566 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.AsyncRetry.<Retry>d__3`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.ProcessSimple.Data.DataProviders.HttpClientDataProvider.<CallService>d__47`2.MoveNext() in C:\__w\1\s\src\processsimple\Roles\ProcessSimple.Data.Shared\DataProviders\Services\HttpClientDataProvider.cs:line 493'.

 

 

AnthonyLatini
Esri Contributor

Hello all. I have been working with our internal Support team on this issue and we are investigating it. Please hold tight while we gather the appropriate information and determine a path to rectify this issue. Thank you.

DominicRoberge2
Occasional Contributor III