Home > Forum > Data sources > REST datasource with variable instead of unique formfield mapping?

REST datasource with variable instead of unique formfield mapping?
0

I want to use a REST DataSource to get customer information (ie name) via customer number. I have a form with a customer number field. I have a REST DataSource "REST GET CUSTOMER DATA" (..../getKundenData?customernumber=CUSTOMERNUMBER.Standard) which returns a json with all relevant customer data.

I used a business rule to get the value from the REST datasource and a form rule (on value change) to set the customer name (returned from the businessrule).

This is working fine.

The problem is the mapping customernumber=CUSTOMERNUMBER.Standard (MyApp.MyProcess.MyForm.....) in the REST data source. Because of that I can use this REST DataSource only in the context of ONE workflow/form.

Is there a way to pass a value to a REST datasource? Like .../getKundenData?customernumber=variable?

Or are there better ways?

Thanks
Ernst

In reply to: Daniel Krüger (Cosmo Consult)

I also don't have a better idea than using a business rule. Whether it will work or not will depend on your case, you should be aware of this:
Business rule result will be URL encoded.

https://community.webcon.com/forum/thread/5645?messageid=5645

Best regards,
Daniel

Thanks for the answers.

I have solved it (for now) with a global business rule and a rest-datasource(see screenshots). Its working...however that is more then a workaround ;-)

Behind this particular REST service is a big database containing about 90.000 records. I cannot get ALL and filter them in the form...


I would need a way to pass parameters to a REST data-source

Then I could use it as datasource like "REST GET ACCOUNTS(argument1 = customerid.value, argument2 = abcd)" ...as an example ;-)

I really hope WEBCON implements such a functionallity.

We are new to WEBCON, so maybe there are other ways to work with big third party databases behind REST apis.

Thanks Ernst