Question

I have been struggling very much with handling collection type response parameters in web services.

When response parameters are or normal type they are very easy to handle in the business processes. Here we are able to handle them as parameters on the Call web service process element. And use these in the process right away.

When there is a Collection which is returned, this is very different. Now the Call web service element parameter is of type Collection of Objects with attributes.

It seems to me that this parameter-type is very difficult to handle in the business process. I can't seem to find documentation in the Academy about how to extract and loop through the contents of the Collection of Objects with attributes.

What I have found in the academy is this article about setting up the Web service.
https://academy.bpmonline.com/documents/administration/7-14/adding-resp…

What I need to learn is how to handle them in bpm'online business processes.
Is there something about this in the Academy?
Is writing source code the only option? It's difficult to debug.

Like

3 comments

Dear Julius,

Unfortunately, it is impossible to handle parameters that have the “collection of object” type without using the source code.

Therefore, in this case we recommend using “ScriptTask” element for both calling the web-service and processing the results of call.

For more detailed assistance, please contact technical support.

Best regards,

Norton

Norton Lingard, Thank you. Is there anything like this in the academy? Because there is a special bpm'online syntax to go by in the source-code.

Dear Julius,

The service call in a "Script task” business process element can be implemented via native C#. Please find a lot of examples on how to do that in Google. For example, several links below:

https://stackoverflow.com/questions/9620278/how-do-i-make-calls-to-a-rest-api-using-c

https://code-maze.com/different-ways-consume-restful-api-csharp/

Please note that it is possible to use the native C# collections instead of working with the the special bpmonline collections.

Best regards,

Norton

Log in or register to comment
Question

Hello, i am trying to integrate the form my friend have on his Wordpress website to the CMS.
Looked at the API Docs and found that Web-to-Object best suitable to what im trying to do.

Any way i dont have his credentials, i am build for him the function ready to put inside the wordpress, so i opened account (free for 14 days) only for this testing.

Thats what my json looks like:
The formId took from the landingId in the frontend script.

'formData' => [
                'formId' => '6c24a5e4-a08c-41c5-a868-19b49197a152',
                'formFieldsData' => [
                    ['name' => 'Contact', 'value' => 'Ohad Goldstein'],
                    ['name' => 'Contact.Mobile', 'value' => 'Ohad Goldstein'],
                    ['name' => 'Contact.JobTitle', 'value' => 'Ohad Goldstein'],
                    ['name' => 'Contact.Email', 'value' => 'Ohad Goldstein'],
                ]
            ]
to: https://008995-marketing.bpmonline.com/0/ServiceModel/GeneratedObjectWe…

I am always getting an error: 
{"SaveWebFormObjectDataResult":"{resultMessage:\"Not allowed request URL.\",resultCode:-1}"}

Even trying to request authenticate first (which succeed) -> grab the cookie -> and append him to this request header along with the BPMCSRF, and still this error.

I saw one old post with same error message and the respond was to update the domain to https://hooks....
But that was from zapier, what should i do for testing from my computer (localhost...) or later on when deployed the code and that will sent from the server ip probably.

One more question how can i edit the needed fields for the form in the admin panel ?
many of the form fields he want to pass does no configured in the leads table...

Thanks ahead

Like

3 comments

Hello Ohad,

If you want to pass fields that are not present at "Lead" object, you should add them, so they will appear at "Lead" table. You should use object designer: https://academy.bpmonline.com/documents/technic-sdk/7-13/workspace-object-designer

In your case I recommend to create a simple landing page as it is described in article: https://academy.bpmonline.com/documents/technic-sdk/7-13/creating-web-case-landing-pages

Then, catch the query that is sent to the bpm'online (in network tab in devtools or Fiddler). The function that you are trying to create, should perform similar query.

Development process is more convenient when you have a system that is deployed on your local machine: https://academy.bpmonline.com/documents/administration/7-13/deploying-bpmonline-application-site

Regards,
Alex 

Alex_Tim,

Hey Alex,

Thanks for the answer,
Where is that "The object designer workspace" located for creating my own custom objects ?

I think i was wrong for trying to use the Web-To-Object request, i am trying to send that request from the server side; i am getting success message when using the  "/0/dataservice/json/reply/InsertQuery" request. Am i right about this ? or still should use the "Web-To-Object"..

Ohad Goldstein,

Hello, dataservice (as well as entitydataservice) can be used for integration with bpm'online. InsertQuery request is used for creating entities. Feel free to use the dataservice as you wish. 

You can find designer in advanced settings menu in system designer. http://prntscr.com/n7vbs4

Regards,
Alex

Log in or register to comment
Question

Hi community, good morning.

I have a web-to-lead landing page that shows 2 errors:

1 - When submitting the form, the lead is getting created properly, however I keep getting the following response (detail: Lead registration method is not mapped on third party´s page and even if it is mapped the same error occurs. Also, I setted it to be defaulted to a LookUp value on the DEFAULT VALUES tab of the Landing Pages.):

{"SaveWebFormObjectDataResult":"{resultMessage:\"Record was not added to the \\\"Lead registration method\\\" object. Name field must be filled in\",resultCode:-1}"}

2 - Even after submitting the form, the redirection page is not showing up.

Please, could you provide me some thoughts?

Thanks.

Like

2 comments

Dear Danilo,

1. Typically, such error appears when there is one of the following:

- The field mapped on the landing has the name, which does not correspond to the one in the system. For instance, capital/non-capital letters, incorrect prefix for the field.

- The field is required on the object, but not filed in. However, since the lead is created successfully, this is not your case.

Please double-check that the default value in the landing settings is set for the corresponding field and fields are correctly mapped.

2. Inn order to determine why landing is not redirecting, please run a debug procedure. You can use use the following library

https://webtracking-v01.bpmonline.com/JS/create-object-debug.js

instead of the standard one, which is indicated in the form ( <script src="https://webtracking-v01.bpmonline.com/JS/create-object.js"></script>).

Regards,

Anastasia

Anastasia Botezat,

Thanks for you answer, Anastasia. However, the field is not on the landing page and it is not required. I added it to the Default Value tab and the value is not getting set at all. The value has a default value on the Configuration as well. 

Anyway, I will try to debug with webtracking tool. Thanks.

Log in or register to comment
Question

Looking at creating leads via the Web-to-Object service but sourced not from a web landing page but an API service.  The documentation seems to imply I can do this as this is an external system.

I was trying to post JSON data to this Web-to-Object service from Zapier with their generic POST action.  The process runs successfully, but a "Not allowed request URL" message is returned from my bpm’online instance or landing page record.  I know from a previous forum post here the Website Domains property needs to be set properly.  I have tried their domain, subdomains, and others per their support (e.g.  hooks.zapier.com).

Is the Website Domains “whitelisting” feature only apply to actual web page sources or does this restriction work with external services like Zapier (or Mulesoft, custom)?  Any help to POST to these bmp'online service via Zapier or other external process would be welcome.

Service Output

{
    "SaveWebFormObjectDataResult": "{resultMessage:\"Not allowed request URL.\",resultCode:-1}"
}

 

Like

1 comments

Hello!

You set not full website domain. 

This value must looks like https://hooks.zapier.com

Log in or register to comment