You are viewing limited content. For full access, please sign in.

Question

Question

Search Repository finds document when testing but not when workflow is run

asked on January 25, 2021

I'm having some trouble with a Search Repository step in a Workflow.

 

Here's what I'm doing:

In Forms, I have a process for submitting new user account requests. Within this process, if the requested user is external to our organization, I'm triggering a public process for submission of our Confidentiality Agreement (sending a link to the public process in an Email Service Task) . Since public processes can't be tucked inside other processes (so my account request process won't know when that public process has completed), I want to use Workflow to identify when that Confidentiality Agreement has been returned.

In the URL that opens the public process (for the confidentiality agreement), I'm passing the InstanceID of the account request process. Then, when the public form is submitted, I'm saving that InstanceID into the metadata of the confidentiality agreement, in a field named ReferenceID. This all works.

 

I'm building a Workflow that launches from my account request process. 

I'd like this Workflow to search the repository to see if the confidentiality agreement is there (looking for a form with the metadata field of ReferenceID that matches the InstanceID of the account request process). If it finds the confidentiality agreement, I'd like it to Set Business Process Variable (variable named conf_agreement_returned = TRUE). 

 

Here's my problem:

My search query will return "1 result found" if I manually enter the values into the "Test Search Query" box, BUT... when I actually run the Workflow, I always get "No entry was found". I tried adding a 5 minute timer in the process between sending the link to the form and checking to see if the document is there (I'm submitting immediately in testing), but that didn't help, so I don't think there's a timing issue.

Here's my search query:

{[]:[ReferenceID]="%(BP Instance ID)"} & {LF:LOOKIN="myRepo\IT Userforms\%(RetrieveLaserficheFormsContent_year)\%(RetrieveLaserficheFormsContent_request_type)\%(RetrieveLaserficheFormsContent_last_name), %(RetrieveLaserficheFormsContent_first_name)"}

 

It's the same result whether I have quotes around %(BP Instance ID) or not.

 

Can anyone assist?

0 0

Answer

SELECTED ANSWER
replied on January 25, 2021

And all the other parameters for your search that build your folder path for the document exist and are correct?

1 0

Replies

replied on January 25, 2021

Have you tried running the search query from LF client?

1 0
replied on January 25, 2021

I'm not sure what you mean.

The Workflow is launched from Forms.

I can see that the document I'm "searching" for is in the repository.

And as I said, if I enter the parameters manually in the "Test Search Query" box, it does find it successfully. 

If there's somewhere else I can enter the search query to test it, that's not something I'm familiar with.

0 0
replied on January 25, 2021

I meant just run your search query directly from the client to make sure it finds a document.  Belt and suspenders.

 

 

0 0
replied on January 25, 2021 Show version history

I didn't know I could do that.

When I entered my search info there, it built a Search Query with a different syntax:

 

({LF:Basic~="%(BP Instance ID)", option="LTF"}) &  {LF:LOOKIN="myRepo\IT Userforms\%(RetrieveLaserficheFormsContent_year)\%(RetrieveLaserficheFormsContent_request_type)\%(RetrieveLaserficheFormsContent_last_name), %(RetrieveLaserficheFormsContent_first_name)"}

 

I'm testing this now.

 

Edit: and yes, this did return the document in the repository

0 0
replied on January 25, 2021

If the search works in the repository, it should work in workflow. Next you'll need to confirm you are actually getting the BP instance ID from forms.

0 0
replied on January 25, 2021

Nope. This query gives the same result as before. If I enter the parameters in the "Test Search Query" box manually, it finds one entry, but if I run the workflow as part of my process, I get No results were found. 

After my workflow has completed, when I search for it (under Recent Activity), I can see the correct FormsBPInstanceID on the Parameters tab, so I know it is getting this info from Forms.

0 0
SELECTED ANSWER
replied on January 25, 2021

And all the other parameters for your search that build your folder path for the document exist and are correct?

1 0
replied on January 25, 2021

Well, I feel foolish. There was a typo in my variable name. It is finding the result now. Thank you so much for your time!!! I will mark this as the correct response.

1 0
replied on January 25, 2021

Hi Jennifer,

If when you find 1 entry manually, and 0 entry when your workflow running, in my mind is because you are using a variable in your search query and then this variable is not correct.

 

In your Workflow, try to check your variable using "Follow the tokens" .

On the right side, under the properties, check "particular tokens" and select the variable you are using for your search query.

 

Then execute your workflow and check your variable.

 

1 0
replied on January 25, 2021

I just replied above that I did have a typo in my variable name. 

 

This information is incredibly helpful, though. Thank you so much!!!

0 0
replied on January 25, 2021

I'm not as confident with Workflow as I am with Forms. I'd love to see a sample workflow that does something similar (searches for a document and sets a variable if found). Sounds simple enough, but I've found nothing is ever as easy as it should be...

0 0
replied on January 25, 2021

How is this workflow started?

0 0
replied on January 25, 2021

This Workflow is started by Forms. It's a part of the process for submitting new account requests. The user submits the request form, if the request is for an external user, we send the URL to the public process, which asks them to sign and submit our confidentiality statement, then the process starts this Workflow (after a wait).

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.