Hi All
I've got a flow, part of which is a List Records CDS action - with my test data it is listing two records from my Quote entity (but it could be only one or could be several). I want to put two of the fields from each record (Service and Fee) into an HTML table and then put that into an email.
I've spent several hours playing around with it, and trying out things I've seen on other threads in this forum, but have now got stuck!
So far I've worked out that the output from my List Records action is an "object" but, to be useful for my purposes, needs to be an "array" - so I've initialised an array variable and have appended the List Records output to it. (I'll paste the full content of the array variable below).
I have then done an Apply to Each with a Select action (see screenshot below) to pull the Service ("_cr47b_service_value") and Fee ("cr47b_fee") fields from each "record" in the array.
However, the output I get from the Apply to Each action only includes the data from the first of the two records - I therefore think that the Apply to Each action is only seeing one "record" in the array.
Does anyone have any ideas as to how I can solve this?
Thanks!
Simon
Hi @sdowse ,
Please check this similar thread and see if it helps:
How to collect information from different outputs ... - Power Platform Community
Best Regards,
Hi @Hardesh15
I think I've done it! I was creating the variable from the "body" of the List Records action output, but I noticed another option called "values" in the dynamic content - so I thought I'd try adding that to the array variable - but that didn't work, with the error saying that the "values" output is already an array.
So I tried a Search action direct from the "values" of the List Records action and it found both the records. See screenshots below (the flow is a bit of a mess as I keep trying out different things!). All I need to do now is to use the Service ID to pull out the Service Name from its entity so my clients can see some sensible data in their emails!
Thank you so much for your time and help.
Simon
Pls share complete flow screens.
Your select action has two records- [{},{}] see carefully
Thanks
Hardesh
In that case you variable has only one value and you are supplying this value as input in next Apply to each.
Thanks
Hardesh
Hi @Hardesh15
I've just been reading some of your posts on another thread!
No, it wasn't in an apply to each - I had tried that previously but it just duplicated the text shown at the bottom of my original post - i.e. whole of the text appeared twice. Although in that case the Search action did pick up two "records", but the values returned were both the same as it was picking up the values from the first "record" in each of the two copies ("_cr47b_service_value": "24c2f1e8-f09d-ea11-a812-000d3a0ae2f1" and "cr47b_fee": 725.
When you did this-"appended the List Records output to it. (I'll paste the full content of the array variable below)."
is apply to each action used in appending?
Thanks
Hardesh