Home > Forum > Rules, JS, SQL > Query SharePoint list in business rule

Query SharePoint list in business rule
0

Hello Community,
is it possible to check whether a value exists in a sharepoint list before I create a new entry via workflow action? What's the best way to do it? Can I use a data connection to query for a certain value in a business rule?

Thanks!

MVP

Hi Oliver,

yes, you can access a data source in a business rule. For this you can select the data source from the Objects tab and then filter it / compare the result.

I had a similar case:
I needed to upload a new version of the document but it was necessary to delete the old document to prevent access to old versions.
After uploading the document, I stored the item id in a technical field.
When a new version was uploaded, it's checked via REST, whether the item still exists.
If this is the case, the item get's deleted.

Since the REST action throws an error, when the item id doesn't exist, I stored the response in a local parameter of the automation. It's necessary to switch "Continue execution if http.."
Afterwards I checked the ResponseCode in an if operator.

Best regards,
Daniel

MVP
In reply to: OliverZellmann

Hi Daniel,

Thanks for your reply. I can't seem to get that "DATA SOURCE VALUE +" placeholder from your first screenshot. For me it will always look like in the picture I attached. Can you specify the path you took to get there?

Thanks

Oliver

Hi Oliver,

as far as I can guess, you are using a form rule which doesn't support this.
Only business rules can access the data source.
If necessary you could also call a business rule from a form rule.

I hope you don't get confused with the terms. I have never used the German interface, so I don't now them. :)

Edit:
I may have confused something, to many different topics at the moment.
You can find the data source value under the functions.

Best regards,
Daniel