Resource not found for the segment issue in Power Automate/Microsoft Flow
Recently , I have come across this issue with Power Automate while I am trying to create a record using “Create a new record ” action with Common Data Service(Current environment) connector based on some trigger.
I am not doing any complex stuff, just creating a quote line record and referencing a quote record. Referencing records is as simple as using dynamic content and populating it to a lookup attribute right !!! No, its not. Let’s see.
I just run the flow with the above setup and flow run got failed with “Resource not found for the segment ‘c262238e-fc89-ea12-ba11-000d3ab615df'”
After some digging , found the cause. The new CDS ( Current environment) is the culprit. Issue is with the way of referencing attributes .It expects referenced attribute values in “Odata Id” format i.e
EntityNameInPlural(Record’sId/GUID).
So here in my case, for quote lookup attribute I should give like /quotes/(Record’s Id/GUID).
After making the above change, flow has run successfully.
The interesting thing is If you use old CDS connector, you wont face this issue. But we cannot be compromised to use old one cause the new connector gives us lot of advantages. Like, option to configure multiple trigger . Read here.
If you want to know the difference between CDS vs CDS (Current environment) connectors, refer this excellent article by Sara Lagerquist (MVP)
Hope it helps. Original post is from my blog.
Comments
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
a slight variation to answers above:
I have a Dataverse table called "campuses" (Note the 'es' at the end). The plural to the table name adds another 'es'.
Therefore Power automate requires the Logical Table name to be /campuseses(id).
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
Same issue here, using the new Dataverse action:
Thanks!
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
@binkster Hi ,
need help
We have cases and there is filed resolved by defining the date before the case should close,
If the user didn’t close the case before that , then it should send an email to case owner manager ,
As per you said , I have fetched the xml ,
We already have a template to send such emails ,
And those emails are send out from a particular email id
I am trying to user below from a video I saw in YouTube
Below error am getting while doing a test run
An error occurred while validating input parameters: Microsoft.Crm.CrmHttpException: Resource not found for the segment 'a2af287a-5df3-e511-810e-3863bb35dfe8'.
at Microsoft.Crm.Extensibility.OData.CrmEdmEntityReference.CreateCrmEdmEntityReference(Uri link, IEdmModel edmModel, CrmODataExecutionContext context, EntitySetSegment& entitySetSegment)
at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitiveData(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, CrmEdmEntityObject& result)
at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitive(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, CrmEdmEntityObject& result)
at Microsoft.Crm.Extensibility.ODataV4.CrmODataActionPayloadDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)
at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
I had to use something like this:
/contacts(emailaddress1='my@email.com')
Hope that's useful.
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
Below is the syntax that works for me for system entity lookups versus custom entity lookups.
Setting a lookup to a system entity:
[system entity plural name]([variable])
For example:
Queues:
Cases:
Setting a lookup to a custom entity:
/[prefix_entitypluralname]([variable])
Important note: My custom entity is called 'Due Diligence' and I set the plural name to also be 'Due Diligence' with no 's'. I did a get record on a specific Due Diligence record, and the odata output tells me that there is an 's' on the end.
Here is a screenshot of the entity names from the 'classic' solution interface (note ther is no 's' in the plural name)
And here is the odata output showing the 's' added on the end.
I then set my lookup in the flow as shown below and it finally worked for me:
So my advice is to do a 'get record' on the entity you want to do a lookup to and confirm what the plural name is and then use that.
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
I just got this working using a Virtual Entity for SCM for sales order lines. I tried many combinations of the slashes and parentheses as described in this blog and the one linked from
unique identifier for entity instances". Don't pick the variable with the normal name for the field by accident!
So, my step to create the virtual entity Sales Order Lines V2 looks like this:
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
Thank you for posting the solution to this. My situation was very similar. In my case, I was pulling the record ID into a variable and placing that in the field as dynamic content thinking "Well it is asking for a GUID, so this should work." It did not work and ended up being very confusing. I was trying to update a field whose LookUp was to the systemusers entity. Using the above suggestion of appending /entityname/(variable with GUID), I was able to get it working:
Something I noticed is even if you aren't creating a flow within a solution, this is still needed if you choose "Current Environment" in the trigger:
I chose this because I plan on adding the flow to a solution in the future. Hope this helps others who may be in a similar boat. -
Resource not found for the segment issue in Power Automate/Microsoft Flow
Having the same problem with a custom entity but no matter what format I try, it can't seem to find it. Ugh...
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
@yamnjjt I fixed the issue by setting the fields to /[EntitySetName]([DynamicField]) or [EntitySetName]/[DynamicField] where I found it worked if I used the former for my custom entities and the latter for default entities such as Accounts. I didn't proceed testing if it's possible to interchange the formats for custom and default entities, as I was too happy to finally get this working 😀
-
Resource not found for the segment issue in Power Automate/Microsoft Flow
Hey @Bluebug
I believe I had a similar issue.
My look up field is
- Display Name: Business Unit
- Name : prefix_BusinessUnit
And in the flow I have entered
/businessunits/{guid}
so it is the displayname in plural and in lower case and without spaces
*This post is locked for comments