Filter Query (OData) in Logic App - azure

I am trying to create a simple logic app to send email if the a field is true.
The flow is:
Get Items From SPO (1) > Filter Array (2) > Send Email (3)
(1): This step, I want to have a quick filter to limit records returned from SharePoint Online:
"queries": { "$filter": "preproccessed eq true" }
(2)(3): another filter applied, then send email
The (2) & (3) run just fines, but the (1) doesn't work at all, all records returned regardless of the filter. I even tried this:
"queries": { "$filter": "preproccessed eq 1" }
But it doesn't work.
Anyone has any ideas what I missed here?
Thank you.

Currently the OData filter is not supported correctly by the SharePoint Online connector, resulting in all rows being returned regardless of the specified filter condition.
As a workaround, you can use the Filter array card to filter the records in the Logic App itself (or use the Query action type if you are authoring your logic directly in code view).
{
"type": "Query",
"inputs": {
"from": "#body('Get_items')?['value']",
"where"": "#equals(item()?['preproccessed']?['Value'], 1)"
},
"runAfter": { "Get_items": [ "Succeeded" ] },
}

Related

Insert User through Sharepoint batch send HTTP Request Connector

I need to insert items into sharepoint by using SP connector - Send HTTP Request
I send body : "User": { "Key": "i:0#.f|membership|#{first(body('Get_by_mail')?['value'])['Email']}" },
Despite it having successfully created, the sharepoint shows the field without value. Do you have any idea what could be going on?
After reproducing from my end, I could able to make this work using the below JSON in the body while sending the HTTP request.
{
"__metadata": { "type": "SP.Data.<YOUR_LIST_NAME>ListItem" },
"Title": "ccc",
"UserId": 6
}
UserId is the key which represents the column in my Sharepoint which is named as User. Consider if Person is the column in your Sharepoint then make sure you set the key value as PersonId.
Results:
If you look at your JSON:
"User":
{
"Key": "i:0#.f|membership|#{first(body('Get_by_mail')?['value'])['Email']}"
}
you'll notice that you're sending just a key to a key/value pair target. The item inserts because a Key is provided, but it doesn't display anything because you did not provide a Value that would be displayed. Try the following JSON instead:
"User":
{
"Key": "i:0#.f|membership|#{first(body('Get_by_mail')?['value'])['Email']}",
"Value": "i:0#.f|membership|#{first(body('Get_by_mail')?['value'])['Email']}"
}

Associated PXSelect/PXSelectReadOnly Returns Nothing on Sales Order Through OpenAPI

I've introduced a new DAC and a new field on the Sales Order associated to the new DAC key. When trying to retrieve the information through OpenAPI it comes back empty. I'd like to know why and how I can adjust my code to return the information. I've tried both PXSelect and PXSelectReadOnly
Declaring Statement on SOOrderEntry(extension):
public PXSelect<IOCSCompanyBrand, Where<IOCSCompanyBrand.companyBrandNbr,
Equal<Current<SOOrderExt.usrCompanyBrand>>>> CompanyBranding;
When I hit the URL: http://localhost/Acumatica21/entity/AcumaticaExtended21R1/20.200.001/SalesOrder?$select=OrderNbr,CompanyBranding,OrderType,CompanyBrand&$expand=CompanyBranding&$filter=OrderNbr%20eq%20'SO-030003'
This is the data that is returned:
[
{
"id": "f827cb43-9b8a-ec11-a481-747827c044c8",
"rowNumber": 1,
"note": {
"value": ""
},
"CompanyBrand": {
"value": "IO"
},
"CompanyBranding": null,
"OrderNbr": {
"value": "SO-030003"
},
"OrderType": {
"value": "SO"
},
"custom": {}
}
]
Acumatica Version: 21.205.0063
Here's the definition for SalesOrder in the endpoint (which was populated via the GUI)
I ended up opening a Acumatica Developer case and here is their response.
Hi Kyle,
Thanks for your time yesterday.
Endpoint mapping is valid but the fields in the view isn't fetch due the limitation of the filter parameter in the request. Filter parameter optimizes the data that are being fetch. In the case, the customer view isn't fetched. To workaround the limitation, instead of using filter, you can try something like below,
http://localhost/Acumatica/entity/AcumaticaExtended21R1/20.200.001/SalesOrder/SO/SO-030007?$expand=CompanyBranding
You can fetch the record and use expand to get the detail level fields. This way you can avoid the limitation of the filter.
Please check and let me know if you have any questions.
Regards,
Vignesh

Azure devops boards REST API - move ticket between columns

I'm testing out the Azure Boards rest API. I can currently create, delete and get items successfully, however I can't seem to move them between columns.
This is my request
https://{{AzureBoardsToken}}#{{AzureBoardsPath}}/_apis/wit/workitems/8907?api-version=6.0-preview.3
with a payload of
[
{
"op": "move",
"path": "{no idea what to put here}",
"from": "{no idea what to put here}",
"value": "{not sure if this is relevant for this operation}"
}
]
I don't find the documentation particularly useful as it assumes you know what those properties mean and where to get them.
Any help would be highly appreciated! The idea is to then integrate it in nodejs
Solution 1
To move workitem to another column you have to change "WEF_{id}_Kanban.Column" field.
Use PATCH to update your workitem with body:
[
{
"op": "replace",
"path": "/fields/WEF_F9DCD9224F6E466499435017DB7D2D07_Kanban.Column",
"value": "<column name>"
}
]
Solution 2
To move workitem to another column you have to change it "state". This only works if you assigned that state to the column.
Use PATCH to update your workitem with body:
[
{
"op": "replace",
"path": "/fields/System.State",
"value": "<column name>"
}
]
doc: https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-6.0
EDIT (Adding new state):
Go to organization settings -> Process -> choose your workflow -> choose item type -> states -> new state (Add "In progress" here)
Tutorial: https://learn.microsoft.com/en-us/azure/devops/organizations/settings/work/customize-process-workflow?view=azure-devops#add-a-workflow-state
Then go to column setting on Kanban Board and associate new state with column
Tutorial: https://learn.microsoft.com/en-us/azure/devops/boards/boards/add-columns?view=azure-devops#update-kanban-column-to-state-mappings
After that try using API REST to change state, it should work
To alter the System.State of a task I had to alter the System.Reason as well. For some reason the two fields are connected and both changes are necessary to trigger a transition from one column to the other.
For example to change a task from the state To Do to In Progress use the Work Items - Update REST API with the following request body:
[
{
"op": "replace",
"path": "/fields/System.State",
"value": "In Progress"
},
{
"op": "replace",
"path": "/fields/System.Reason",
"value": "Work started"
}
]

Azure Graph API Filter by array value

I'm trying to execute an query on my users of my Azure B2C Active Directory.
So far everything works fine with the following query:
https://graph.windows.net/myTentant/users?$filter=
startswith(displayName,'test')%20
or%20startswith(givenName,'test')%20
or%20startswith(surname,'test')%20
or%20startswith(mail,'test')%20
or%20startswith(userPrincipalName,'test')
&api-version=1.6
The thing about that is, that this properties are just simple values like this:
"displayName: "testValue",
"givenName": "testValue",
"displayName: "testValue",
"surname": "testValue",
"mail: "testValue",
"userPrincipalName": "testValue",
In my case I need to use one more statement, in which I need to check an array if it contains 'test' like the others. This array look like that:
"signInNames": [
{
"type": "emailAddress",
"value": "test#mail.com"
}, {
"type": "emailAddress",
"value": "test2#mail.com"
}
]
I Already search in the official documentation but had no luck....
Any ideas?
In theory, we should use the following format to determine whether the value starts with "test".
GET https://graph.windows.net/myorganization/users?$filter=signInNames/any(c:startswith(c/value, 'test'))
Unfortunately, it will show an error: value only supports equals-match. PrefixMatch is not supported.
And the contains string operator is currently not supported on any Microsoft Graph resources. So we can't use contains neither.
You need to use equal to find the exact match dataļ¼š
GET https://graph.windows.net/myorganization/users?$filter=signInNames/any(c:c/value eq '***')
It is not a solution. But there seems not to be a way to meet your needs.
Maybe you could query all the signInNames and handle them in your code.

Acumatica REST API - StockItem - How to use UOMConversions from response

In Acumatica REST API - StockItem
I am using the url https://sandbox.kimballinc.com/AcumaticaERP/entity/Default/18.200.001/StockItem?$filter=InventoryID eq '12345' & $expand=UOMConversions
In the response i am getting UOMConversions object as
"UOMConversions": [
{
"rowNumber": 1,
"note": null,
"ConversionFactor": {
"value": 1
},
"FromUOM": {
"value": "EACH"
},
"MultiplyDivide": {
"value": "Multiply"
},
"ToUOM": {
"value": "FOOT"
}
}
]
I want to know how ConversionFactor, FromUOM, MultiplyDivide, ToUOM is used and possible values for these fields.
can you please help me in understand these fields. Thanks
In order to find more information on that , I would recommend that you connect to the Acumatica site in the browser, Navigate to the Stock Item screen and go to the help page for that screen(Tools -> Help).
Once on the help screen, search for the "Unit Conversion Table" you will then find more information about these fields.
For the values that are available, I would recommend once again to go to the browser and the screen itself. Open the selector for the "From Unit" field and the drop-down for the "Multiply/Divid" field. The "Conversion" being just a decimal number and the "To Unit" being a read only field that take for value the base unit of the Stock Item.

Resources