Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Power Automate Parameters #686

Open
simondowse opened this issue Apr 8, 2022 · 4 comments
Open

Error with Power Automate Parameters #686

simondowse opened this issue Apr 8, 2022 · 4 comments
Labels

Comments

@simondowse
Copy link

Hi

I thought I'd let you know that I had a small issue with the Power Automate Parameters today....

I've attached a screenshot of the query builder - when I viewed the Power Automate Parameters the Expand Query option was as shown below. The link entity that is shaded grey in the screenshot did not get included, instead the one above it was duplicated - I have shown the duplicate entry in bold below.

Obviously I could get around the issue by changing the text in the expand query, but it foxed me for a while - mostly because I have absolutely no training in any of this stuff and am just learning as I go!

I hope that is helpful.

Simon

Expand Query output from View the Power Automate Parameters:
cr47b_Instruction_PrimaryContact_Contact($select=cr47b_instructionref),sls_cr47b_Instruction_KeyholderContact_Contac($select=cr47b_instructionref),sls_cr47b_Instruction_VendorContact_Contact($select=cr47b_instructionref),sls_cr47b_Invoice_InvoicePrimaryContact_Conta($select=cr47b_invoiceref),cr47b_InstructionLegalParty_Contact_Contact($select=cr47b_instructionref),cr47b_InstructionLegalParty_Contact_Contact($select=cr47b_instructionref),cr47b_Invoice_Contact_Contact($select=cr47b_invoiceref),sls_cr47b_Company_Contact_Contact($select=cr47b_name)


  • Deployment: Online
  • DB Version: 9.2.22032.145
  • Connection Controls Version: 1.2021.9.46
  • XrmToolBox Version: 1.2022.2.54
  • Tool Version: 1.2022.3.1
    Screenshot 2022-04-08 200526
@rappen
Copy link
Owner

rappen commented Apr 12, 2022

Thanks, I will try to see the problem, and what I can do about it.

@rappen rappen added the bug label Feb 6, 2023
@eleung83
Copy link

It seems like some of the power automate generated parameters aren't valid if directly copied straight into a Power Automate Flow. For example, the following Fetch XML will generate these Power Automate parameters:

image

image

But there's a couple of issues with the expand query:

  1. Empty parentheses throw an error when the Flow is executed
  2. "In" operator on a linked entity has to be placed within a $filter operator of the expand node of the linkentity, rather than being in the primary filter itself.

So the expand should be: parentcustomerid_account(),ownerid($filter=Microsoft.Dynamics.CRM.In(PropertyName='name',PropertyValues=['Test','Test2']))

And perhaps a warning about the empty parentheses (or perhaps default it to include a $select with the entity primary key if no attributes have been specified within the fetchxml)?

@rappen
Copy link
Owner

rappen commented Aug 4, 2023

Thanks @eleung83

I know these days @MarkMpn is better at these issues... Can you have a look? I think it's issues with inner link-entities filters...

@MarkMpn
Copy link
Collaborator

MarkMpn commented Sep 4, 2024

I'm not sure this query can be translated properly to Web API. Because the link to the owner is an inner join, simply moving the filter to inside the expand does not give you the same results as it would return all the contacts but only show the owners that match the in query - essentially an outer join. In fact, if you change the link-type to outer you should see this filter move into the expand clause.

The conversion moves this filter to the outer $filter clause to replicate the inner join logic, but I haven't found a way of making this work with the extended query functions like In - please let me know if you find a way of writing this query that works. It should translate it correctly if you replace the in filter with multiple eq filters, e.g.

<link-entity ...>
  <filter type="or">
    <condition attribute="name" operator="eq" value="Test" />
    <condition attribute="name" operator="eq" value="Test2" />
  </filter>
</link-entity>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants