Hi all,
I'm at the end of a flow, but I'm having a problem getting record ID as I need to use it into create new record action with a lookup field.
I'm first initializing variable ste
Then searching inside CDS for an existing webinar, once have found the webinar I'm passing the webinar into an Appends value to an array variable.
Later in the flow, I'm having a condition where I need to use the CDS webinarid value, but I have access neither to the webinar properties nor the value that I passed to the array step.
Any help is appriaciated
Regards
Kiril
Yes, that way it worked.
I've changed the expression in the Compose step to
first(outputs('List_CRM_Webinars')['body']['value'])
Then removed and recreated for the No path the Create new registered user step, but outside of the loop, and for the webinar filed I've used the expression
first(outputs('List_CRM_Webinars')['body']['value'])['new_webinarsid']
Appreciate your help with this struggle 😀
Regards
Kiril
I'd say it is because your apply to each is running twice (based on your run history above). I think you probably don't need any apply to each loops (based on what you have said). You can adapt the code I gave you above and use that as the basis for your record creation. You see this:
first(outputs('List_CRM_Webinars')['body']['value'])['new_webinarsid']
Gets just the webinarsid from your first record, but this:
first(outputs('List_CRM_Webinars')['body']['value'])
Would give you everything from that record. If you used this as the basis for your no condition instead of the array (which is only every going to contain one record). Then you would have no need of an apply each.
You would probably lose the dynamic content, but you could easily pass the output of:
first(outputs('List_CRM_Webinars')['body']['value'])['new_webinarsid']
Into a parse JSON step, which would make it easy for you to select dynamic content again and would remove all of the apply/each steps as it would no longer be an array, but an object.
It's workiiiiiiiiing 🤗
I'm just wondering why there are two records created (both exactly the same)
Try this instead:
first(outputs('List_CRM_Webinars')['body']['value'])['new_webinarsid']
Nope, now i have this error:
Unable to process template language expressions in action 'Compose_for_CRM_Webinar' inputs at line '1' and column '27619': 'The template language function 'first' expects its parameter be an array or a string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#first for usage details.'.
Try:
first(body('List_CRM_webinars'))['value'][0]['new_webinarsid']
Hi @Paulie78 ,
I've done this:
first(body('List_CRM_webinars')['new_webinarsid'])
But i'm getting the following error message
Unable to process template language expressions in action 'Compose_for_CRM_Webinar' inputs at line '1' and column '27619': 'The template language expression 'first(body('List_CRM_webinars')['new_webinarsid'])' cannot be evaluated because property 'new_webinarsid' doesn't exist, available properties are '@odata.context, value'. Please see https://aka.ms/logicexpressions for usage details.'.
But the field actually exists and the name is correct as I copy it from the outputs
Am I doing something wrong?
I would take a slightly different approach. Take your Find Webinar step out of the "apply each" loop. Then use a compose step and use the first expression to get the first (and only) record from that array. Your compose step will then contain the record that you want to reference. If you want it to contain only the webinar ID you could do something like:
first(body('Find_webinar')['fieldName']
This will then give you something you can easily refer to in the remainder of the flow.
actually, there is a record
I think this might be because there is no records return from List CRM webinars, can u check the flow run history if there is returned values and if so we Can add a condition to check if the list records has returned value or not