Hi All,
I have a custom connector that is working perfect, the problem that I'm facing is that I cannot get the properties from the outputs.
This is what my custom connector returns
Solved! Go to Solution.
I would do this:
From:
outputs('Get_attendees_for_all_webinar_sessions')['body']
webinarKey:
item()['webinarKey']
organizerKey:
item()['organizerKey']
This will produce a neat JSON array, like this:
[
{
"webinarKey": "8423865868034504719",
"organizerKey": 7990114028417116000
},
{
"webinarKey": "6348927997217270275",
"organizerKey": 7990114028417116000
}
]
Hello @Radoslavov ,
the error tells you that the expression 'outputs('Get_attendees_for_all_webinar_sessions')?['body']' that you use as the input of the 'Apply to each' is not an array, it can't loop through it.
Since it says it's an Object, you should use it as the input of 'Parse JSON' directly, without 'Apply to each'.
Hi @tom_riha , thanks for helping me out with this.
The Apply to each gets added automatically since there will be more than one record returned (Get_attendees_for_all_webinar_sessions). However now I'm getting this error message when running flow with the Parse JSON
The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@outputs('Get_attendees_for_all_webinar_sessions')?['body/attendeeParticipationResponses']' is of type 'Null'. The result must be a valid array.
I would just add a compose with the following expression:
outputs('Get_attendees_for_all_webinar_sessions')['body']['_embedded']['attendeeParticipationResponses']
That brings you directly to your array, and produces output like this:
[
{
"registrantKey": "5114028005263885579",
"sessionKey": "24277491",
"email": "user1@gmail.com",
"joinTime": "2021-02-08T12:06:19Z",
"leaveTime": "2021-02-08T12:08:30Z",
"attendanceTimeInSeconds": 131,
"attendance": [
{
"joinTime": "2021-02-08T12:06:19Z",
"leaveTime": "2021-02-08T12:08:30Z"
}
],
"firstName": "User",
"lastName": "Test"
}
]
Which you can then easily loop through.
Well..it worked, but the flow failed for some reason because it returns two outputs.
I'm not sure what they are two when there is only one attendee returned from Get Attendees step.
I think this is happening because of the Apply to Each, but the problem again is that from the List webinars step i actually only need to values
to be able to get_attendees but when I add them from the output option of list webinars they are put into applying to each.
Perhaps if I can get only these two values webinarkey and organizerkey , this will not put the entire logic into application to each.
You can easily do that, but the JSON you have posted here is very different from the one above. Which one is accurate?
It is the last one I've posted, this is the JSON from List Webinars step containing details about the webinar, which later one I need to pass when getting the attendees.
I would do this:
From:
outputs('Get_attendees_for_all_webinar_sessions')['body']
webinarKey:
item()['webinarKey']
organizerKey:
item()['organizerKey']
This will produce a neat JSON array, like this:
[
{
"webinarKey": "8423865868034504719",
"organizerKey": 7990114028417116000
},
{
"webinarKey": "6348927997217270275",
"organizerKey": 7990114028417116000
}
]
That is great, the only thing that left is actually to get from here
the "email" value so I can use it inside Apply to each to search in CDS for existing Contact with this email address
It is in Apply to each since there will be always more than one attendee returned from the list of attendees.
so that would simply be item()['email'] inside of the apply each loop
I have to say big..no HUGE thank you @Paulie78
This was an extremely hard task for me, but again thanks to you, we''ve completed the process. I hope with time I will become better with these expressions and would help others like me in such situations. With practice comes experience 😊
Thanks again.
Kiril
Thank you, my pleasure!
When one teaches, two learn!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
28 | |
27 | |
20 | |
10 |