• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

How to do correct task to update wordpress user?

Status
Not open for further replies.

bennyj

Member
I need to create a workflow which is doing this scenario:

When the user's woocommerce subscription status changes to on hold. The user role changed to Free User.

So, I created a workflow:
  1. Trigger: Woocommerce: Subscription Updated

  2. Filter by Pabbly: Only Continue If...
    Select Label: 1.Status : on-hold (map data)
    Filter type: Equal to
    Value: 1.Status : on-hold (map data)

  3. Task: Wordpress: Search User
    Search Keyword: 1. Billing Email: (map data)

  4. Task: Wordpress: Update a User
    User ID: (map data)
    Email Address: (map data)
    Username: (map data)
    Role: dropdown (only default roles, can't choose the custom roles, so I use the default roles to test it)
The workflow runs successfully but, I have 2 problems by using that workflow.
  1. The updated user task changes the user first name, last name, password, and other fields, even I have remove the field from the Task. For example, the task changed the first name to become {{first_name}}. So it didn't change only the user role but all the fields too. So, how to change only the user role?
  2. How to get my custom roles? For this example, I want to choose my custom role which is Free User.
And last question. Did I doing it right? Because I'm not sure about my workflow. Thanks.
 

Supreme

Well-known member
Staff member
Hey @bennyj
The updated user task changes the user first name, last name, password, and other fields, even I have remove the field from the Task. For example, the task changed the first name to become {{first_name}}. So it didn't change only the user role but all the fields too. So, how to change only the user role?
We have made some changes to Wordpress's "Update a User", so it wouldn't overwrite the fields. Please try again at the end and let us know if still get stuck at any place.

How to get my custom roles? For this example, I want to choose my custom role which is Free User.
You can pass your custom roles by just typing in the name of the role like mention below.

2021-08-24_11h34_27.png


2021-08-24_11h39_17.png
 

bennyj

Member
Hi @Supreme Verma

Thanks for the update, I realized that I need to let the field exist with empty field to make it works. If I remove the field, it will overwrite the fields again.

And then here comes the problem.. which is the password field.

If I didn't remove the password field, it prompts an error because it is required. But if I remove it, then it will overwrite the password fields on the user.

So I think, it will be better if someone remove the fields, it means that fields will not be overwrite by the task. How about that?
 

Supreme

Well-known member
Staff member
Hey @bennyj

We have removed the required from the Password field and now it wouldn't overwrite the details while updating the WordPress Users.

Please check at your end and let us know if the issue persists.
 
Last edited by a moderator:

bennyj

Member
Hi @Supreme Verma,

I just realized that username label and value disappears on response received results in Wordpress: Search User task.
Because of this, I couldn't get the username from the results and I can't use it in Wordpress: Update User task.

Could you tell me how to get the username please? Thanks.
 

Supreme

Well-known member
Staff member
Hey @bennyj

While searching the contact if the name and its details have been filled while creating or already exists. Then only you will get the name label and more according to Wordpress's API.

Further, we have made some changes in Update User as per your request. Please check this out, I hope this might help you.

2021-08-25_16h59_23.png
 
Status
Not open for further replies.
Top