![]() |
#1 |
Участник
|
gustafwesterlund: Formating Web API query for getting VoC Survey questions
Источник: http://gustafwesterlund.blogspot.com...tting-voc.html
============== Working with a Flow to do some text analysis and sentiment analysis on Voice of the customer responses. The trick, as the payment model is per run, is to trigger it per Survey Response, and not Question Response. Hence the logic has to loop through all the question responses. The way you create a filter in Flow for the query is to use Odata filters. However, I found that these were a casing nightmare, which those of you who have worked with more, probably also have noticed. After troubleshooting a lot with different queries in the browser I finally found that the following actually worked. Note that you will have t change the guid to your own. https://dev-dtn.api.crm4.dynamics.com/api/data/v9.1/msdyn_questionresponses?$select=msdyn_name,msdyn_SurveyResponseId&$filter=msdyn_SurveyResponseId/msdyn_surveyresponseid%20eq%20460279E7-2AF2-E811-A97F-000D3AB0C08C The tricky part, as you can see, is that the first part of the lookup attribute, is defined in camel-case and the one in the related entity (Survey Response) in lower case. The part you need in the Flow is the last part, but it is useful to test it directly in the browser to make sure you get the syntax correct. ![]() And this is how it looks in Dynamics 365 CE if you check out the fields. I like to look at them in the list view as I can see the schema name there, which isn't visible in the Form. ![]() ![]() Hence based on the above, the supposition would be that the syntax is / I then did a query to business Unit and I was very surprised to find that it was rather inconsistent and looked like this: https://dev-dtn.api.crm4.dynamics.com/api/data/v9.1/businessunits?$select=cntso_organizationbaseurl&$filter=parentbusinessunitid/businessunitid%20eq%20null with just the query that would be parentbusinessunitid/businessunitid eq null Let's have a look at the fields in Dynamics: ![]() ![]() And as you can see, if we were to follow the syntax set by the example above, this should be: ParentBusinessUnitId/businessunitid However, that didn't seem to work, and as a pragmatist, I have to conclude, somewhat sad, that this doesn't seem to be very consistent. My recommendation is hence when working with this:
And if you know Swedish, make sure you check out my colleague Martin Burmans article on Flow as well. Not sure how well it turns out in translation. https://www.crmkonsulterna.se/flow-i-medvind/ Gustaf Westerlund MVP, Founder and Principal Consultant at CRM-konsulterna AB www.crmkonsulterna.se Источник: http://gustafwesterlund.blogspot.com...tting-voc.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|