How can I search multiple value one time?

I face a challenge How can I search multiple value one time?.
I hope you help to this question, Is there a way to search multiple value one time?
For example: I want to copy 100 cells from excel and paste it into search field in a grid of a form application.

Can you help me please?
Regards;

Its possible certainly… so they paste 100 fields into a large TextBox…
You would need to echo that TextBox content to see what the delimiter is… then you could Explode the string and foreach each var and do what you need to do with them.

Perhaps like this:

$n=0;
$pasteData={textbox};
$work=explode("/t",$pasteData);//not sure about this delimiter…
foreach($work as $item)
{
$sql=" SEARCH for $item here";//insert into temp table or whatever ?
[somevar]=$result;//set a session var?
$n++;//increment the counter
}
///
echo “There are $n search results”;
///

2 Likes

Thank you very much for answering my question.

But I am not a professional like you, can you please explain the steps to me?
And how can I implement it on a grid or a form application?

Can you help me do search by copying and pasting multible data once time and making multible edits… and I am ready to pay you

Dont use the Search option to do this as we cant access the variables entered into the Search box ( at least I don’t know how to do it)

I would make a Control application with a Multiple Line text box.

Whatever gets pasted into there you have to clean up (remove delimiters) and set whatever is pasted into a usable session array.

Then redirect it to your Grid.
Not knowing your table structure… this next step is up to you…

On the grids OnScriptInit, do a sc_select_where(add) =
" fieldname LIKE (’%[sess_array]%’)
Or
FIND_IN_SET ([arrayitem1],fieldname) >0 OR FIND_IN_SET ([arrayitem2],fieldname) >0 etc etc

1 Like

I am very much appreciated and thanks for your great answer, but I couldn’t solve the problem.
I searched the forum dozens of pages and tried a lot without success.
This is what I have experienced.
Please can you correct my mistakes.


Before I try this but I want to put(paste) dozens values one time

Sincerlly;

When you paste the array of values with the semicolon delimiter, you need to work with it in the OnValidate event so its usable by the Sql query

Turn it into an array.
[myarray2] = array();
[$yarray = explode(";",$pastedValues);
[myarray2] = implode(",",$myarray);
Now use My Array2 in your Where sql… ech it out to make sure it is set up properly but you should be able to do a WHERE employeeNum IN ([myarray2])

2 Likes

It is wonderfull response
But I still don`t know how to run it.
Can you please look at this picture, It works good


But how I make multiple search inside this a grid application

Thanks in advance

Echo out your Sql by going to turning on the Debug…not sure why that isnt working.

the grid it working very good only without control like this:



But when working with control it show this error like this:
image

I don’t know where the error


I changed the code by putting
WHERE EmployeeNo IN (’[myarray2]’)
So, No error but without result

I think error in this line


because the grid app is working good
but control app this error

Thanks in advance

Do this:
WHERE EmployeeNo IN ([myarray2])

(without the single quotes)

1 Like

I already do that, and it working very good in a grid application
But it shows an error with control application
Thanks in advance

Thanks for God.
I solved the issue by modifing the previous code like this:
WHERE EmployeeNo IN ([Text_Multiple])

But I have another issue that I can’t slelect multiple records in the grid application,
Although I put this code:


image
:point_down:

Can you please help me?

Thanks in advance

Thank you very much for your help
The code worked successfully

I am so grateful for all the help you have given me