cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PAB1
New Member

Creating a row from a row in a separate entity with lookup fields and option sets (Power Apps Flow and CDS)

Hi 

I am trying to write a Flow that will create a series of child records from a template entity when the parent record has been created. My Flow is a standard pattern:

  • When a record is created..
  • Get a record (get the record created above – not sure if this is needed – but this was shown in the many posts I have looked at)
  • List Records (these are the template records) 
  • Apply to Each
    • Create a new record

The issue I have are:

  1. The template record includes a field with an Option Set - which is replicated on the target table - the Create record provides the associated drop down list to select the required option - but I want to drive the value from the template record (in the list) and not hard code it in the “Create Record” applet 
  2. The created record needs to be linked to the parent record using the key from the header record (which triggered the flow) – while I can see the “guid” (I also performed an export to excel from Dynamics to verify I had the correct one)  for this record I constantly get -  “Resource not found for the segment” – I have reviewed various posts on the net and none of these seem to work. i.e. TableName(Key Value), /TableName(Key Value)

My entity name is

PAB1_0-1603725211073.png

I have tried

  • PAB1_1-1603725211077.png

     

  • I have also tried the above without the “/”
  • I have also tried the above in the singular with and without the “/”
  • and for completeness I have tried pab_assessmentheader 

Each time I get (or similar)

{

  "error": {

    "code": "0x0",

    "message": "Resource not found for the segment 'Assessment Headers'."

  }

}

 

Without the Entity name ( i.e. the Assessment Number) I get

{

  "error": {

    "code": "0x0",

    "message": "Resource not found for the segment '0dd15e08-6117-eb11-a813-000d3ad7eea3'." - Which is the correct GUID for the item

  }

}

 

Either what I am trying to do - can't be done (which I hope isn't the case) or I have missed something that is glaringly obvious.

 

Many thanks

 

Tony

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
HSheild
Super User
Super User

Hi @PAB1 

 

1. You are able to set an Option Set value to a dynamic value.  So just populate this with the value from template entity

2. For the lookup you need to use pab_assessmentheaders(GUID).

View solution in original post

6 REPLIES 6
summitb
Power Participant
Power Participant

Have you tried /Prefix_SchemaName/{Guid}

HSheild
Super User
Super User

Hi @PAB1 

 

1. You are able to set an Option Set value to a dynamic value.  So just populate this with the value from template entity

2. For the lookup you need to use pab_assessmentheaders(GUID).

View solution in original post

I have tried this and it works without the leading "/" - I thought I had previously tried this option .

PAB1_0-1603735710310.png

 

Thank you for the advice

I am still struggling with the "Option Set" issue - I have tried using the value this does not seem to be carried forward into the  - but I will continue to look at it

PAB1_1-1603736057606.png

 

PAB1_0-1603735994028.png

 

Thank you for the advice

Oops! It would helped if I had checked the contents of the template entity - all issues now resolved

 

Thanks for the help

 

Tony

summitb
Power Participant
Power Participant

You can put custom values in optionset fields like 10000, 10001 etc.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Kudoed Authors
Users online (2,928)