cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MinhPham96
Level: Powered On

Store a Patch item to a collection get value error

Hello, I currently build an app that has two screens, the first screen I need to input all the travel info to make a request, then I need to push it to my CDS entity, then I need to get the just created travel ID to map with the customers in another table. I use patch to create new item in my Travel entity and store the item in a collection. This is the code: 

 

2019-12-06_15-37-41.png

 

Then I try to read some data from the collection and get the following error:

 

2019-12-06_15-38-41.png

 

I notice that the suggested field is presented in Name instead of Display Name which is not what I usually see. 

 

2019-12-06_15-37-10.png

 

How can I solve this case ? Did I do it correctly or is there any other approach. Thank you for reading. 

 

Best Regards,

 

Minh Pham

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Store a Patch item to a collection get value error

Hi @MinhPham96 ,

 

The collection is a Table, so TravelItem. new_name is the single-column table. However the parameter of Notify function should be a text, so you should use First(TravelItem).new_name to get the new_name of first record.

Best regards,

Sik

View solution in original post

2 REPLIES 2
Microsoft v-siky-msft
Microsoft

Re: Store a Patch item to a collection get value error

Hi @MinhPham96 ,

 

The collection is a Table, so TravelItem. new_name is the single-column table. However the parameter of Notify function should be a text, so you should use First(TravelItem).new_name to get the new_name of first record.

Best regards,

Sik

View solution in original post

MinhPham96
Level: Powered On

Re: Store a Patch item to a collection get value error

Dear @v-siky-msft , thank you for answering. I realized it was a collection so I changed ClearCollect() to Set() so it would store the item in a variable instead. First() is also a good approach, I have never heard of First() so this could be handy for me in the future. 

 

Best Regards,

 

Minh Phạm 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,138)