I am using creatio API to get the object collection data from Creatio, in which lookup values have Ids. I want to replace those Ids with their Name saved in look ups. 

 

@Community, My question is, how can I get data of specific look up from Creatio using creatio API Odata4

Like 0

Like

1 comments

Hello!

 

To get the data of a specific lookup you need to use the following request:

https://sitename.creatio.com/0/odata/Lookup(lookup_id)

 

If you want to get the content of such lookup, then you should make a request directly to the object which the lookup is connected to. For example:
https://110032169-demo.creatio.com/0/odata/Account(record_id)

 

Have a nice day!

Show all comments

Hello @Community,

 

I am using Creatio API OData4 to get the data from Creatio Object Collection.

I wanted to filter the data base on date and time. Is there a way to get only last 3 months data with Odata4?

Like 0

Like

1 comments

Hello,

 

You can use the following filtering:
$filter=CreatedOn ge 2024-08-05T00:00:00Z

 

https://documenter.getpostman.com/view/10204500/SztHX5Qb?version=latest

Show all comments

Hello community!

 

I'm trying to filter contacts by unique keys from another system.

Currently, we are using 'eq' and 'or', but that has a limitation (the error states that only 100 nodes are supported in a filter).

After reading the oData 4.01 documentation that is linked in the creatio documentation here https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/architecture/development-in-creatio/integrations#title-2088-10, I found the "in" operator, which might bypass this issue completely, so we wouldn't need to page through records.

 

However, I couldn't get it to run...my filter looks like this:
 

$filter=["QsTbisKey"] in ["47928","50447"]

But it returns an error:

{
    "error": {
        "code": "",
        "message": "An error has occurred.",
        "innererror": {
            "message": "The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; odata.metadata=none'.",
            "type": "",
            "stacktrace": "",
            "internalexception": {
                "message": "Object reference not set to an instance of an object.",
                "type": "",
                "stacktrace": ""
            }
        }
    }
}

 

I tried using all combinations of other brackets and single quotes but was unsuccessful.

 

Does anyone know how to do this?

 

Thanks and BR,

Robert

 

Like 0

Like

4 comments
Best reply

Hello,

The 'in' operator is not supported in OData 4 in Creatio.
At the moment, it is possible to use the operators that are available in the examples in the official Postman collection of the Creatio API.
We have registered a task to improve this functionality ('in' operator for Creatio OData 4 requests) in future releases of Creatio.
 

Correct filter for In operator OData 4.01 is usually like:

filter=Id in ('6f2efedd-9b25-43b4-9cb9-0ebe60a02a8a','72509ae9-7065-465c-b7c5-3d193b8fe768')

However, it produces the same result with Creatio OData. It's possible Creatio only implements OData 4.0 and not 4.01 (which introduced the In operator).
Might need a different approach like a configuration service that takes the like of values as a param and returns the results? Or if it would work to create a common parent record of the values that could be used to retrieve the results?

Ryan Farley writes:

Correct filter for In operator OData 4.01 is usually like:

filter=Id in ('6f2efedd-9b25-43b4-9cb9-0ebe60a02a8a','72509ae9-7065-465c-b7c5-3d193b8fe768')

However, it produces the same result with Creatio OData. It's possible Creatio only implements OData 4.0 and not 4.01 (which introduced the In operator).
Might need a different approach like a configuration service that takes the like of values as a param and returns the results? Or if it would work to create a common parent record of the values that could be used to retrieve the results?

 

Hi Ryan,

I did try that syntax already, but it didn't work.

Maybe someone from Creatio can shed some light on the implemented OData version?

 

Thanks,

Robert

Hello,

The 'in' operator is not supported in OData 4 in Creatio.
At the moment, it is possible to use the operators that are available in the examples in the official Postman collection of the Creatio API.
We have registered a task to improve this functionality ('in' operator for Creatio OData 4 requests) in future releases of Creatio.
 

Serhii Parfentiev,

Thanks for the information!

Since the documentation I linked explicitly points to the OData 4.01 version, it should be updated and the exact version should be mentioned to know what is supported and what is not.

 

Thanks,

Robert

Show all comments
Question

Hi All. 
Is there a way to pass a display value in odata rather then the GUID for the lookup values? 
 

Like 0

Like

1 comments

Hello Yuriy,
 

Let's try to do this on the example of the Contact object using the OData protocol version 4.0.

For the Contact object, in our case, the displayed value is the Full Name column (Code of the column Name).

displayed value

Name column
 

Let's take as an example the record of one contact by UId

https://1303997-demo.creatio.com/0/odata/Contact(51e3822e-0944-45bc-98b6-8a171802df84)

OData response by UId

Our task is to get this contact record by searching the Name column with the value Andrew Wayne.
 

If you look at the official examples of requests to the Creatio app via OData, the query will best suit our needs 


https://1303997-demo.creatio.com/0/odata/Contact?$filter=Name%20eq%20%27Andrew%20Wayne%27

This is the result we got

filter

I hope I understood you correctly and was able to provide a comprehensive answer.

 

I wish you a good day!

 

Show all comments

I am looking to filter an odata request within power automate to return only records where the modifiedon date is greater than a specified value. I have thus far tried the following without success:

 

$filter=ModifiedOn%20gt%20datetime'2023-05-23T00:00:00.0000000Z'

 

{ "error": { "code": "", "message": "The query specified in the URI is not valid. Unrecognized 'Edm.String' literal 'datetime'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetime'2023-05-23T00:00:00.0000000Z''.", "innererror": { "message": "Unrecognized 'Edm.String' literal 'datetime'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetime'2023-05-23T00:00:00.0000000Z''.", "type": "", "stacktrace": "" } } }

 

$filter=ModifiedOn%20gt%20cast('2023-05-23T00:00:00.0000000Z','Edm.DateTimeOffset')

 

{ "error": { "code": "", "message": "The query specified in the URI is not valid. The binary operator GreaterThan is not defined for the types 'System.Nullable`1[System.DateTime]' and 'System.Object'.", "innererror": { "message": "The binary operator GreaterThan is not defined for the types 'System.Nullable`1[System.DateTime]' and 'System.Object'.", "type": "", "stacktrace": "" } } }

 

$filter=ModifiedOn%20gt%20'2023-05-23T00:00:00.0000000Z'

 

{ "error": { "code": "", "message": "The query specified in the URI is not valid. A binary operator with incompatible types was detected. Found operand types 'Edm.DateTimeOffset' and 'Edm.String' for operator kind 'GreaterThan'.", "innererror": { "message": "A binary operator with incompatible types was detected. Found operand types 'Edm.DateTimeOffset' and 'Edm.String' for operator kind 'GreaterThan'.", "type": "", "stacktrace": "" } } }

 

$filter=ModifiedOn%20gt%20datetimeoffset'2023-05-23T00:00:00.0000000Z'

 

{ "error": { "code": "", "message": "The query specified in the URI is not valid. Unrecognized 'Edm.String' literal 'datetimeoffset'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetimeoffset'2023-05-23T00:00:00.0000000Z''.", "innererror": { "message": "Unrecognized 'Edm.String' literal 'datetimeoffset'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetimeoffset'2023-05-23T00:00:00.0000000Z''.", "type": "", "stacktrace": "" } } }

 

Any suggestions for how to achieve this would be much appreciated. Thanks.

Like 0

Like

2 comments

This works for me

$filter=ModifiedOn gt 2024-05-14T00:00:00Z

I don't know if there is something specific for power automate, but in just accessing the Creatio odata api this is valid.

Ryan

Hello,

 

The correct way to format the filter in your OData request is by using the Edm.DateTimeOffset type directly, but the format should be specific. Here’s how you can do it:

https://website/yourentity?$filter=ModifiedOn gt 2023-05-23T00:00:00Z

Show all comments

Hi Community,

We have a simple string field in one of our Creatio instances that is not being updated (tested with a Supervisor user).

Field is NOT being updated in the following scenarios

1- Frontend: When we save the record page.

2- Application Layer : The field is not being update from Bussines Processes.

3- OData4 : We tried to update from Postman with OData4 request, without success

 

Is there any lock mechanism that prevents the field from being updated written in CSharp?

 

The field can only be updated when we perform an Update directly in the database layer.

 

Thank you

Sasor

Like 0

Like

1 comments

Hello!

 

This means that there can be logic at the event layer level that changes the value of this field when saving a record. It can be on action: OnUpdating, OnSaving. Details here:

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

 

Or changing a given field leads to another action that changes its value again.

To track exactly where this field changes, you can write additional logging when the record is saving, in various methods, such as OnUpdating and OnSaving, on the EntityEventListener. This logging will help you find exactly where the field value changes.

Show all comments

Hi Community,

In the OData4 protocol the maxTopLimit parameter

defines the limit for the value in the maximum number of rows in the output (which is 20.000 records)

We are retrieving the data from the Accounts table which has around 40.000 records.

What is the workaround or fix for this scenario?

Sasor

Like 0

Like

1 comments
Best reply

You can use the $top and $skip parameters to retrieve the data in pages. 

For example: 

Page 1 (first 1000)

https://creatiourl/0/odata/contacts?$top=1000&$skip=0

Page 2 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=1000

Page 3 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=2000

etc

Ryan

You can use the $top and $skip parameters to retrieve the data in pages. 

For example: 

Page 1 (first 1000)

https://creatiourl/0/odata/contacts?$top=1000&$skip=0

Page 2 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=1000

Page 3 (next 1000) 

https://creatiourl/0/odata/contacts?$top=1000&$skip=2000

etc

Ryan

Show all comments