Filter data using Q Parameter in Oracle VBCS

Filter data using Q Parameter in Oracle VBCS

What is the use of query parameters?

Query parameters are a defined set of parameters attached at the end of a URL. They are extensions of the URL used?to help define specific content or actions based on the data being passed.

You can use query parameters to control what data is returned in endpoint responses.

Query Parameters:

You can use the following query parameters in the Connect REST API.

No alt text provided for this image
No alt text provided for this image

Applying the Q parameter through VBCS. choose the endpoint; let’s start with the back end.

No alt text provided for this image

You may see various names along with their types and values in the request under the Query Parameter heading. Additionally, there are options that must be checked if you want to mark them as mandatory.

No alt text provided for this image

Try using just one of the names. onlyData has Boolean values that are true or false, indicating that the user simply wants to view the data in the API response without links or additional attachments.

Limit refers to the user’s ability to access a specific amount of data in the request listed below limit.

No alt text provided for this image

According to the request, this is the output. A request that has a limit and only data for the Q parameter.

Count indicates how many items in the response, as we requested for 1 limit that’s we can get 1 value in count.

No alt text provided for this image

orderBy, which denotes the ascending or descending order of a field’s data. In the example below, we have used bodyType:desc.

bodyType: field name

desc: descending

No alt text provided for this image

The response that is shown depends on the Q parameter that we have mentioned.

No alt text provided for this image

You can try it with the front-end by creating a service data provider (SDP) or array data provider (ADP), choosing the endpoints, and mentioning the key attribute in that.

Please check out our previous blog post, “Creating a simple VBCS application in 5 Easy Steps,” if you are not sure how to define variables and types.

No alt text provided for this image

After making a variable, make a table to show the output from the user interface. We must choose the appropriate fields in the table’s properties for the various fields it contains.

CarsDetails is the name of a table we have created using a VBCS business object; alternatively, ICS or ORDS can be used.

Now you can see the list of parameters in the map variables to parameters section on your right under the targets. We are applying inside the variable in a manner similar to how we tested from the back end.

First try with the limit, limit = 5

No alt text provided for this image

In this output, the table only shows five records.

No alt text provided for this image

Try using the bodyType field and descending as an attribute with orderBY which is applied for the same table.

No alt text provided for this image

In the table BodyType result, the first row of output begins with the letter S for SUV.

No alt text provided for this image

The orderBy function assumes an ascending format if you only include the field name. In the following image, the field name is all that is mentioned.

No alt text provided for this image

This is the output, with the bodytype’s first row value beginning with the letter H in HATCHBACK.

No alt text provided for this image
No alt text provided for this image

Currently, there is only one field name under the fields listed, limit is 15, and orderBy ascending.

No alt text provided for this image

This is the response to the prior request.

No alt text provided for this image

Examples:

orderBy: model:desc

expand: contacts.names

In the previous instance, contacts.name is specified as being part of the HCM contacts api.

If a user wishes to obtain information from a name, such as a first name, middle name, last name, full name etc they must expand the name just like?parent and child.

We have discussed this in the extend parameter section.

finder : $functions.getConversionRate($page.variables.carsdetails.Currency, $page.variables.currencyData.ToCurrency, $page.variables.currencyData.UserConversionType, $page.variables.currencyData.startDate, $page.variables.currencyData.endDate)

All the variables that have specified values are listed above.

/fscmRestApi/resources/11.13.18.05/currencyRates?finder=CurrencyRatesFinder;fromCurrency=INR,toCurrency=USD,userConversionType=Corporate,startDate=2005-01-19,endDate=2005-01-20

This is being used to determine fscm’s currency conversion rate.
















要查看或添加评论,请登录

Conneqtion Group的更多文章

社区洞察

其他会员也浏览了