I have a profile type which uses an autocomplete field which references to another profile. As an entity type i selected user and for filtering the results i use an entity selection with views where i choose what view to filter my content. So far so good , but i've seen that i can pass additional arguments to the view. My question is: How could i pass the input from autocomplete to the referenced view ? ( what should i type in the view arguments field to get the input from autocomplete ? )
What you're asking doesn't quite make sense if I understand it correctly. You see, the view you're choosing when setting up the field is used before your user has even entered anything in the auto-complete field. So you can't have that be an argument. The view is generated and used prior to any input.
The view is used simply to determine which set of users are available for the auto-complete field. It doesn't make sense to generate the view after the user has already entered in a value, because at that point they've already made a selection anyway.
So - I'm wondering, since you're asking about basing that view on user input, if what you're looking for is simply something like the 'auto-complete' functionality which exists with entity and user/node references. If you select for your field to be Autocomplete, when the user starts typing in a username, a list of related suggestions will automatically appear at the bottom.
Here's an example of a user reference field with autocomplete turned on
The solution was to create a module which it will alter the query executed by the view and by grabbing the input from url generated by the autocomplete.