Hi...this is my first time posting to this forum. Thanks to anyone able to offer any solutions. I've been stumped on this error within my canvas app for quite a while now when I click the Submit New User button. I couldn't find much info on it, so I guess it's a pretty obscure problem.
Onselect of the button, I have the formula entered:
ClearCollect(UserInsert,UserCollection);
Patch(UserInsert,Defaults(UserInsert),
{Company Name:'Company Input'.Text,Department:'Department Input'.Text,Email:'Email Input'.Text});
ClearCollect(UserSuccess,Azure_AD_Guest_Users_SFConnect.InsertUserData({schema:"xxxxx",table:"xxxxx",'Content-Type':"application/json",Accept:"application/json",body:UserSuccess}))
I'm trying to call a custom API/connector (Azure_AD_Guest_Users_SFConnect.InsertUserData) from my app that uses an Azure Function I built that's supposed to insert data into a snowflake DB. I've already built the custom connector according to an article I found explaining how all of this done. Find it here.
And here's the request definition that I created for the custom connector (I can provide more detail here if needed).
Fairly new to Power Platform, so any advice on this error is much appreciated. Please let me know if there's any additional information/files I can provide to help bring out a solution. Thanks!
Please post this as a new question. You'll get more responses and others will be able to find the answer more easily later. If you'll add some screenshots of the flow you are using and send me a link to the new post I'll try to help you there.
I am SO ready to go running, screaming into the night!!!!! @Pstork1, you say that a collection is ALWAYS an array of objects. I created a Power Automate flow with a response schema that looks like:
Can't do much of an example since I don't have access to your custom connector. But it would be something like this in place of the collection.
Set(UserInsert,{Company Name:'Company Input'.Text,Department:'Department Input'.Text,Email:'Email Input'.Text});
ClearCollect(UserSuccess,Azure_AD_Guest_Users_SFConnect.InsertUserData({schema:"xxxxx",table:"xxxxx",'Content-Type':"application/json",Accept:"application/json",body:UserInsert}))
Hi @Pstork1 , thank you for that. Makes perfect sense. Could you offer up either one of those solutions in a generic example? That way, I can see the exact syntax that I need to use.
The problem is that a collection is always an array of objects, even if there is only one object in the collection. But your API is expecting you to pass it an object, not an array. That's why you are getting the error. You can either build the input as a record in a variable or use First() to get the first record in your collection when you do the submission.