function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
soma s 6soma s 6 

Flow

I want to use flow, my requirement is i have account records and have phone number field  in account record, user will update the account record then my flow should collect the account records which has same phone number and update certain field value . how to do in flow, i dont know what to enter in the below screen shot " enter value" please advise.
User-added image
JethaJetha
In this case, you have to use flow in combination with Process.

When someone edit a record, that process would fire.
soma s 6soma s 6
Jetha ,I agree but please advise me what value I should enter in the enter value. 
JethaJetha
So you have to create one variable in FLOW, and assign value to that variable throgh process builder and put that variable over here in the enter value section..........
soma s 6soma s 6
HI Jetha
              I am sorry am new to this process builder and flow, to set value in a variable in process builder do we need any apex code or i can directly assign variable and set value please advise
User-added image
JethaJetha
Hi Soma, Don't worry. We are all here to help you out.

First you need to create one Flow and in that flow create one variable as text say for example "PhoneNumber".

Now in processbuilder, you need to select Launch a flow as action type.

When a select flow as an action, you can assign phone number from account record to the newly created flow variable PhoneNumber.


And that variabe can be further used in your FLOW.

Let me know if you have any other issue.
soma s 6soma s 6
HI Jetha
              I have achived the above thanks a lot, can I use SOQL query in process builder ? please advise.

    
JethaJetha
It's good to hear from you that you have achieved the functionality.

Yes, you can perform SOQL query in process builde. For that you need to run Apex as an action.

In Apex you can right your custom logic.

Don't forget to mark as the best answer if above solution helped you to achieve functionality...
soma s 6soma s 6
Hi
     If the count of collection is morethan one then only i will call the flow , how to do this, i can write Apex class and get collection , it seems i should declare global variable in apex class and set value if the count is greater than one, am i right please advise.