cancel
Showing results for 
Search instead for 
Did you mean: 

Resource not found for the segment issue in Power Automate/Microsoft Flow

image.png

 

 

 

 

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.

 

image.png

 

 

 

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'”

 

image.png

 

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).

 

image.png

 

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

Had the same issue. If you want to update a custom entity, don't forget the prefix to get it up and running! 

@SandraSoniec I'm facing the same issue with a custom entity. Can you please advise how to reference it. Please provide a screenshot if possible.

 

Prefix: fsdyn

Custom entity name: Transport Reservation Request

 

Thank you!

@SkiMiquel Entities have a "display name" and "name". My custom entity has the display name "Standards" and name is "mc_standards". All my custom entities have "mc_" as prefix. You have defined your own during creation of your custom entity. You need to use the name for doing the update. Check the name of your entity in the power apps maker portal under Data > Entities > yourEntity. Then follow the instructions for updates.

I have a custom entity with singular display name "My category", plural display name "My categories" and system name "new_my_category".

When I check https://[org].crm.dynamics.com//api/data/v9.0/new_my_category  I get an error, but when I check https://[org].crm.dynamics.com//api/data/v9.0/new_my_categorys it shows the contents of the entity.

 

However, when I set the lookup for 'Category 1' in my flow to /new_my_categorys/[value from other record] the flow gives the segment error. I've tried every combination I can think of, none will work. Can anyone give a tip on how to fix this?

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

@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 😀

Having the same problem with a custom entity but no matter what format I try, it can't seem to find it. Ugh...

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:
image.png

 

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:

 

image.png

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. 

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 Sara Lagerquist.  What finally worked for me was this: 

1) Be sure to use the prefix for the virtual entity mserp_

2) Be sure the entity name is case sensitive.  I got the exact value from the Odata result from the prior step where I created the sales order header.  (mine showed as all lower case, including the v in 'v2'!)

3) the name of the entity is certainly plural in English, 'entities' in my case, not 'entitys'.  Again, I got the exact spelling by looking at the OData output from the prior step on a test run.

4) I used a forward slash in front

5) I used parenthesis around the dynamic data from the prior step for the "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: 

Blog post.png

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: 

binkster_0-1606252588947.png

 

Cases:

binkster_1-1606252657540.png

 

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)

binkster_3-1606253343535.png

 

And here is the odata output showing the 's' added on the end.

 

binkster_2-1606253094622.png

 

I then set my lookup in the flow as shown below and it finally worked for me:

binkster_4-1606253550437.png

 

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.

Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • SharePoint, Microsoft 365 and Power Platform Developer | Contributor on SharePoint StackExchange
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 12 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/